// Code generated by ent, DO NOT EDIT.

package ent

import (
	"context"
	"errors"
	"fmt"
	"time"

	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"entgo.io/ent/schema/field"
	"github.com/Wei-Shaw/sub2api/ent/batchimagejob"
)

// BatchImageJobCreate is the builder for creating a BatchImageJob entity.
type BatchImageJobCreate struct {
	config
	mutation *BatchImageJobMutation
	hooks    []Hook
	conflict []sql.ConflictOption
}

// SetBatchID sets the "batch_id" field.
func (_c *BatchImageJobCreate) SetBatchID(v string) *BatchImageJobCreate {
	_c.mutation.SetBatchID(v)
	return _c
}

// SetUserID sets the "user_id" field.
func (_c *BatchImageJobCreate) SetUserID(v int64) *BatchImageJobCreate {
	_c.mutation.SetUserID(v)
	return _c
}

// SetAPIKeyID sets the "api_key_id" field.
func (_c *BatchImageJobCreate) SetAPIKeyID(v int64) *BatchImageJobCreate {
	_c.mutation.SetAPIKeyID(v)
	return _c
}

// SetNillableAPIKeyID sets the "api_key_id" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableAPIKeyID(v *int64) *BatchImageJobCreate {
	if v != nil {
		_c.SetAPIKeyID(*v)
	}
	return _c
}

// SetAccountID sets the "account_id" field.
func (_c *BatchImageJobCreate) SetAccountID(v int64) *BatchImageJobCreate {
	_c.mutation.SetAccountID(v)
	return _c
}

// SetNillableAccountID sets the "account_id" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableAccountID(v *int64) *BatchImageJobCreate {
	if v != nil {
		_c.SetAccountID(*v)
	}
	return _c
}

// SetProvider sets the "provider" field.
func (_c *BatchImageJobCreate) SetProvider(v string) *BatchImageJobCreate {
	_c.mutation.SetProvider(v)
	return _c
}

// SetModel sets the "model" field.
func (_c *BatchImageJobCreate) SetModel(v string) *BatchImageJobCreate {
	_c.mutation.SetModel(v)
	return _c
}

// SetTaskName sets the "task_name" field.
func (_c *BatchImageJobCreate) SetTaskName(v string) *BatchImageJobCreate {
	_c.mutation.SetTaskName(v)
	return _c
}

// SetNillableTaskName sets the "task_name" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableTaskName(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetTaskName(*v)
	}
	return _c
}

// SetStatus sets the "status" field.
func (_c *BatchImageJobCreate) SetStatus(v string) *BatchImageJobCreate {
	_c.mutation.SetStatus(v)
	return _c
}

// SetNillableStatus sets the "status" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableStatus(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetStatus(*v)
	}
	return _c
}

// SetProviderJobName sets the "provider_job_name" field.
func (_c *BatchImageJobCreate) SetProviderJobName(v string) *BatchImageJobCreate {
	_c.mutation.SetProviderJobName(v)
	return _c
}

// SetNillableProviderJobName sets the "provider_job_name" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableProviderJobName(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetProviderJobName(*v)
	}
	return _c
}

// SetProviderInputRef sets the "provider_input_ref" field.
func (_c *BatchImageJobCreate) SetProviderInputRef(v string) *BatchImageJobCreate {
	_c.mutation.SetProviderInputRef(v)
	return _c
}

// SetNillableProviderInputRef sets the "provider_input_ref" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableProviderInputRef(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetProviderInputRef(*v)
	}
	return _c
}

// SetProviderOutputRef sets the "provider_output_ref" field.
func (_c *BatchImageJobCreate) SetProviderOutputRef(v string) *BatchImageJobCreate {
	_c.mutation.SetProviderOutputRef(v)
	return _c
}

// SetNillableProviderOutputRef sets the "provider_output_ref" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableProviderOutputRef(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetProviderOutputRef(*v)
	}
	return _c
}

// SetGcsInputURI sets the "gcs_input_uri" field.
func (_c *BatchImageJobCreate) SetGcsInputURI(v string) *BatchImageJobCreate {
	_c.mutation.SetGcsInputURI(v)
	return _c
}

// SetNillableGcsInputURI sets the "gcs_input_uri" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableGcsInputURI(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetGcsInputURI(*v)
	}
	return _c
}

// SetGcsOutputURI sets the "gcs_output_uri" field.
func (_c *BatchImageJobCreate) SetGcsOutputURI(v string) *BatchImageJobCreate {
	_c.mutation.SetGcsOutputURI(v)
	return _c
}

// SetNillableGcsOutputURI sets the "gcs_output_uri" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableGcsOutputURI(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetGcsOutputURI(*v)
	}
	return _c
}

// SetItemCount sets the "item_count" field.
func (_c *BatchImageJobCreate) SetItemCount(v int) *BatchImageJobCreate {
	_c.mutation.SetItemCount(v)
	return _c
}

// SetSuccessCount sets the "success_count" field.
func (_c *BatchImageJobCreate) SetSuccessCount(v int) *BatchImageJobCreate {
	_c.mutation.SetSuccessCount(v)
	return _c
}

// SetNillableSuccessCount sets the "success_count" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableSuccessCount(v *int) *BatchImageJobCreate {
	if v != nil {
		_c.SetSuccessCount(*v)
	}
	return _c
}

// SetFailCount sets the "fail_count" field.
func (_c *BatchImageJobCreate) SetFailCount(v int) *BatchImageJobCreate {
	_c.mutation.SetFailCount(v)
	return _c
}

// SetNillableFailCount sets the "fail_count" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableFailCount(v *int) *BatchImageJobCreate {
	if v != nil {
		_c.SetFailCount(*v)
	}
	return _c
}

// SetCancelledCount sets the "cancelled_count" field.
func (_c *BatchImageJobCreate) SetCancelledCount(v int) *BatchImageJobCreate {
	_c.mutation.SetCancelledCount(v)
	return _c
}

// SetNillableCancelledCount sets the "cancelled_count" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableCancelledCount(v *int) *BatchImageJobCreate {
	if v != nil {
		_c.SetCancelledCount(*v)
	}
	return _c
}

// SetEstimatedCost sets the "estimated_cost" field.
func (_c *BatchImageJobCreate) SetEstimatedCost(v float64) *BatchImageJobCreate {
	_c.mutation.SetEstimatedCost(v)
	return _c
}

// SetNillableEstimatedCost sets the "estimated_cost" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableEstimatedCost(v *float64) *BatchImageJobCreate {
	if v != nil {
		_c.SetEstimatedCost(*v)
	}
	return _c
}

// SetHoldAmount sets the "hold_amount" field.
func (_c *BatchImageJobCreate) SetHoldAmount(v float64) *BatchImageJobCreate {
	_c.mutation.SetHoldAmount(v)
	return _c
}

// SetNillableHoldAmount sets the "hold_amount" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableHoldAmount(v *float64) *BatchImageJobCreate {
	if v != nil {
		_c.SetHoldAmount(*v)
	}
	return _c
}

// SetActualCost sets the "actual_cost" field.
func (_c *BatchImageJobCreate) SetActualCost(v float64) *BatchImageJobCreate {
	_c.mutation.SetActualCost(v)
	return _c
}

// SetNillableActualCost sets the "actual_cost" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableActualCost(v *float64) *BatchImageJobCreate {
	if v != nil {
		_c.SetActualCost(*v)
	}
	return _c
}

// SetCurrency sets the "currency" field.
func (_c *BatchImageJobCreate) SetCurrency(v string) *BatchImageJobCreate {
	_c.mutation.SetCurrency(v)
	return _c
}

// SetNillableCurrency sets the "currency" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableCurrency(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetCurrency(*v)
	}
	return _c
}

// SetHoldID sets the "hold_id" field.
func (_c *BatchImageJobCreate) SetHoldID(v string) *BatchImageJobCreate {
	_c.mutation.SetHoldID(v)
	return _c
}

// SetNillableHoldID sets the "hold_id" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableHoldID(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetHoldID(*v)
	}
	return _c
}

// SetIdempotencyKey sets the "idempotency_key" field.
func (_c *BatchImageJobCreate) SetIdempotencyKey(v string) *BatchImageJobCreate {
	_c.mutation.SetIdempotencyKey(v)
	return _c
}

// SetNillableIdempotencyKey sets the "idempotency_key" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableIdempotencyKey(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetIdempotencyKey(*v)
	}
	return _c
}

// SetRequestHash sets the "request_hash" field.
func (_c *BatchImageJobCreate) SetRequestHash(v string) *BatchImageJobCreate {
	_c.mutation.SetRequestHash(v)
	return _c
}

// SetNillableRequestHash sets the "request_hash" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableRequestHash(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetRequestHash(*v)
	}
	return _c
}

// SetManifestHash sets the "manifest_hash" field.
func (_c *BatchImageJobCreate) SetManifestHash(v string) *BatchImageJobCreate {
	_c.mutation.SetManifestHash(v)
	return _c
}

// SetNillableManifestHash sets the "manifest_hash" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableManifestHash(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetManifestHash(*v)
	}
	return _c
}

// SetRetryCount sets the "retry_count" field.
func (_c *BatchImageJobCreate) SetRetryCount(v int) *BatchImageJobCreate {
	_c.mutation.SetRetryCount(v)
	return _c
}

// SetNillableRetryCount sets the "retry_count" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableRetryCount(v *int) *BatchImageJobCreate {
	if v != nil {
		_c.SetRetryCount(*v)
	}
	return _c
}

// SetVersion sets the "version" field.
func (_c *BatchImageJobCreate) SetVersion(v int) *BatchImageJobCreate {
	_c.mutation.SetVersion(v)
	return _c
}

// SetNillableVersion sets the "version" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableVersion(v *int) *BatchImageJobCreate {
	if v != nil {
		_c.SetVersion(*v)
	}
	return _c
}

// SetOutputExpiresAt sets the "output_expires_at" field.
func (_c *BatchImageJobCreate) SetOutputExpiresAt(v time.Time) *BatchImageJobCreate {
	_c.mutation.SetOutputExpiresAt(v)
	return _c
}

// SetNillableOutputExpiresAt sets the "output_expires_at" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableOutputExpiresAt(v *time.Time) *BatchImageJobCreate {
	if v != nil {
		_c.SetOutputExpiresAt(*v)
	}
	return _c
}

// SetInputDeletedAt sets the "input_deleted_at" field.
func (_c *BatchImageJobCreate) SetInputDeletedAt(v time.Time) *BatchImageJobCreate {
	_c.mutation.SetInputDeletedAt(v)
	return _c
}

// SetNillableInputDeletedAt sets the "input_deleted_at" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableInputDeletedAt(v *time.Time) *BatchImageJobCreate {
	if v != nil {
		_c.SetInputDeletedAt(*v)
	}
	return _c
}

// SetOutputDeletedAt sets the "output_deleted_at" field.
func (_c *BatchImageJobCreate) SetOutputDeletedAt(v time.Time) *BatchImageJobCreate {
	_c.mutation.SetOutputDeletedAt(v)
	return _c
}

// SetNillableOutputDeletedAt sets the "output_deleted_at" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableOutputDeletedAt(v *time.Time) *BatchImageJobCreate {
	if v != nil {
		_c.SetOutputDeletedAt(*v)
	}
	return _c
}

// SetDownloadedAt sets the "downloaded_at" field.
func (_c *BatchImageJobCreate) SetDownloadedAt(v time.Time) *BatchImageJobCreate {
	_c.mutation.SetDownloadedAt(v)
	return _c
}

// SetNillableDownloadedAt sets the "downloaded_at" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableDownloadedAt(v *time.Time) *BatchImageJobCreate {
	if v != nil {
		_c.SetDownloadedAt(*v)
	}
	return _c
}

// SetUserDeletedAt sets the "user_deleted_at" field.
func (_c *BatchImageJobCreate) SetUserDeletedAt(v time.Time) *BatchImageJobCreate {
	_c.mutation.SetUserDeletedAt(v)
	return _c
}

// SetNillableUserDeletedAt sets the "user_deleted_at" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableUserDeletedAt(v *time.Time) *BatchImageJobCreate {
	if v != nil {
		_c.SetUserDeletedAt(*v)
	}
	return _c
}

// SetLastErrorCode sets the "last_error_code" field.
func (_c *BatchImageJobCreate) SetLastErrorCode(v string) *BatchImageJobCreate {
	_c.mutation.SetLastErrorCode(v)
	return _c
}

// SetNillableLastErrorCode sets the "last_error_code" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableLastErrorCode(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetLastErrorCode(*v)
	}
	return _c
}

// SetLastErrorMessage sets the "last_error_message" field.
func (_c *BatchImageJobCreate) SetLastErrorMessage(v string) *BatchImageJobCreate {
	_c.mutation.SetLastErrorMessage(v)
	return _c
}

// SetNillableLastErrorMessage sets the "last_error_message" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableLastErrorMessage(v *string) *BatchImageJobCreate {
	if v != nil {
		_c.SetLastErrorMessage(*v)
	}
	return _c
}

// SetCreatedAt sets the "created_at" field.
func (_c *BatchImageJobCreate) SetCreatedAt(v time.Time) *BatchImageJobCreate {
	_c.mutation.SetCreatedAt(v)
	return _c
}

// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableCreatedAt(v *time.Time) *BatchImageJobCreate {
	if v != nil {
		_c.SetCreatedAt(*v)
	}
	return _c
}

// SetUpdatedAt sets the "updated_at" field.
func (_c *BatchImageJobCreate) SetUpdatedAt(v time.Time) *BatchImageJobCreate {
	_c.mutation.SetUpdatedAt(v)
	return _c
}

// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableUpdatedAt(v *time.Time) *BatchImageJobCreate {
	if v != nil {
		_c.SetUpdatedAt(*v)
	}
	return _c
}

// SetSubmittedAt sets the "submitted_at" field.
func (_c *BatchImageJobCreate) SetSubmittedAt(v time.Time) *BatchImageJobCreate {
	_c.mutation.SetSubmittedAt(v)
	return _c
}

// SetNillableSubmittedAt sets the "submitted_at" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableSubmittedAt(v *time.Time) *BatchImageJobCreate {
	if v != nil {
		_c.SetSubmittedAt(*v)
	}
	return _c
}

// SetStartedAt sets the "started_at" field.
func (_c *BatchImageJobCreate) SetStartedAt(v time.Time) *BatchImageJobCreate {
	_c.mutation.SetStartedAt(v)
	return _c
}

// SetNillableStartedAt sets the "started_at" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableStartedAt(v *time.Time) *BatchImageJobCreate {
	if v != nil {
		_c.SetStartedAt(*v)
	}
	return _c
}

// SetFinishedAt sets the "finished_at" field.
func (_c *BatchImageJobCreate) SetFinishedAt(v time.Time) *BatchImageJobCreate {
	_c.mutation.SetFinishedAt(v)
	return _c
}

// SetNillableFinishedAt sets the "finished_at" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableFinishedAt(v *time.Time) *BatchImageJobCreate {
	if v != nil {
		_c.SetFinishedAt(*v)
	}
	return _c
}

// SetSettledAt sets the "settled_at" field.
func (_c *BatchImageJobCreate) SetSettledAt(v time.Time) *BatchImageJobCreate {
	_c.mutation.SetSettledAt(v)
	return _c
}

// SetNillableSettledAt sets the "settled_at" field if the given value is not nil.
func (_c *BatchImageJobCreate) SetNillableSettledAt(v *time.Time) *BatchImageJobCreate {
	if v != nil {
		_c.SetSettledAt(*v)
	}
	return _c
}

// Mutation returns the BatchImageJobMutation object of the builder.
func (_c *BatchImageJobCreate) Mutation() *BatchImageJobMutation {
	return _c.mutation
}

// Save creates the BatchImageJob in the database.
func (_c *BatchImageJobCreate) Save(ctx context.Context) (*BatchImageJob, error) {
	_c.defaults()
	return withHooks(ctx, _c.sqlSave, _c.mutation, _c.hooks)
}

// SaveX calls Save and panics if Save returns an error.
func (_c *BatchImageJobCreate) SaveX(ctx context.Context) *BatchImageJob {
	v, err := _c.Save(ctx)
	if err != nil {
		panic(err)
	}
	return v
}

// Exec executes the query.
func (_c *BatchImageJobCreate) Exec(ctx context.Context) error {
	_, err := _c.Save(ctx)
	return err
}

// ExecX is like Exec, but panics if an error occurs.
func (_c *BatchImageJobCreate) ExecX(ctx context.Context) {
	if err := _c.Exec(ctx); err != nil {
		panic(err)
	}
}

// defaults sets the default values of the builder before save.
func (_c *BatchImageJobCreate) defaults() {
	if _, ok := _c.mutation.TaskName(); !ok {
		v := batchimagejob.DefaultTaskName
		_c.mutation.SetTaskName(v)
	}
	if _, ok := _c.mutation.Status(); !ok {
		v := batchimagejob.DefaultStatus
		_c.mutation.SetStatus(v)
	}
	if _, ok := _c.mutation.SuccessCount(); !ok {
		v := batchimagejob.DefaultSuccessCount
		_c.mutation.SetSuccessCount(v)
	}
	if _, ok := _c.mutation.FailCount(); !ok {
		v := batchimagejob.DefaultFailCount
		_c.mutation.SetFailCount(v)
	}
	if _, ok := _c.mutation.CancelledCount(); !ok {
		v := batchimagejob.DefaultCancelledCount
		_c.mutation.SetCancelledCount(v)
	}
	if _, ok := _c.mutation.EstimatedCost(); !ok {
		v := batchimagejob.DefaultEstimatedCost
		_c.mutation.SetEstimatedCost(v)
	}
	if _, ok := _c.mutation.Currency(); !ok {
		v := batchimagejob.DefaultCurrency
		_c.mutation.SetCurrency(v)
	}
	if _, ok := _c.mutation.RetryCount(); !ok {
		v := batchimagejob.DefaultRetryCount
		_c.mutation.SetRetryCount(v)
	}
	if _, ok := _c.mutation.Version(); !ok {
		v := batchimagejob.DefaultVersion
		_c.mutation.SetVersion(v)
	}
	if _, ok := _c.mutation.CreatedAt(); !ok {
		v := batchimagejob.DefaultCreatedAt()
		_c.mutation.SetCreatedAt(v)
	}
	if _, ok := _c.mutation.UpdatedAt(); !ok {
		v := batchimagejob.DefaultUpdatedAt()
		_c.mutation.SetUpdatedAt(v)
	}
}

// check runs all checks and user-defined validators on the builder.
func (_c *BatchImageJobCreate) check() error {
	if _, ok := _c.mutation.BatchID(); !ok {
		return &ValidationError{Name: "batch_id", err: errors.New(`ent: missing required field "BatchImageJob.batch_id"`)}
	}
	if v, ok := _c.mutation.BatchID(); ok {
		if err := batchimagejob.BatchIDValidator(v); err != nil {
			return &ValidationError{Name: "batch_id", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.batch_id": %w`, err)}
		}
	}
	if _, ok := _c.mutation.UserID(); !ok {
		return &ValidationError{Name: "user_id", err: errors.New(`ent: missing required field "BatchImageJob.user_id"`)}
	}
	if _, ok := _c.mutation.Provider(); !ok {
		return &ValidationError{Name: "provider", err: errors.New(`ent: missing required field "BatchImageJob.provider"`)}
	}
	if v, ok := _c.mutation.Provider(); ok {
		if err := batchimagejob.ProviderValidator(v); err != nil {
			return &ValidationError{Name: "provider", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider": %w`, err)}
		}
	}
	if _, ok := _c.mutation.Model(); !ok {
		return &ValidationError{Name: "model", err: errors.New(`ent: missing required field "BatchImageJob.model"`)}
	}
	if v, ok := _c.mutation.Model(); ok {
		if err := batchimagejob.ModelValidator(v); err != nil {
			return &ValidationError{Name: "model", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.model": %w`, err)}
		}
	}
	if _, ok := _c.mutation.TaskName(); !ok {
		return &ValidationError{Name: "task_name", err: errors.New(`ent: missing required field "BatchImageJob.task_name"`)}
	}
	if v, ok := _c.mutation.TaskName(); ok {
		if err := batchimagejob.TaskNameValidator(v); err != nil {
			return &ValidationError{Name: "task_name", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.task_name": %w`, err)}
		}
	}
	if _, ok := _c.mutation.Status(); !ok {
		return &ValidationError{Name: "status", err: errors.New(`ent: missing required field "BatchImageJob.status"`)}
	}
	if v, ok := _c.mutation.Status(); ok {
		if err := batchimagejob.StatusValidator(v); err != nil {
			return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.status": %w`, err)}
		}
	}
	if v, ok := _c.mutation.ProviderJobName(); ok {
		if err := batchimagejob.ProviderJobNameValidator(v); err != nil {
			return &ValidationError{Name: "provider_job_name", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider_job_name": %w`, err)}
		}
	}
	if v, ok := _c.mutation.ProviderInputRef(); ok {
		if err := batchimagejob.ProviderInputRefValidator(v); err != nil {
			return &ValidationError{Name: "provider_input_ref", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider_input_ref": %w`, err)}
		}
	}
	if v, ok := _c.mutation.ProviderOutputRef(); ok {
		if err := batchimagejob.ProviderOutputRefValidator(v); err != nil {
			return &ValidationError{Name: "provider_output_ref", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider_output_ref": %w`, err)}
		}
	}
	if v, ok := _c.mutation.GcsInputURI(); ok {
		if err := batchimagejob.GcsInputURIValidator(v); err != nil {
			return &ValidationError{Name: "gcs_input_uri", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.gcs_input_uri": %w`, err)}
		}
	}
	if v, ok := _c.mutation.GcsOutputURI(); ok {
		if err := batchimagejob.GcsOutputURIValidator(v); err != nil {
			return &ValidationError{Name: "gcs_output_uri", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.gcs_output_uri": %w`, err)}
		}
	}
	if _, ok := _c.mutation.ItemCount(); !ok {
		return &ValidationError{Name: "item_count", err: errors.New(`ent: missing required field "BatchImageJob.item_count"`)}
	}
	if _, ok := _c.mutation.SuccessCount(); !ok {
		return &ValidationError{Name: "success_count", err: errors.New(`ent: missing required field "BatchImageJob.success_count"`)}
	}
	if _, ok := _c.mutation.FailCount(); !ok {
		return &ValidationError{Name: "fail_count", err: errors.New(`ent: missing required field "BatchImageJob.fail_count"`)}
	}
	if _, ok := _c.mutation.CancelledCount(); !ok {
		return &ValidationError{Name: "cancelled_count", err: errors.New(`ent: missing required field "BatchImageJob.cancelled_count"`)}
	}
	if _, ok := _c.mutation.EstimatedCost(); !ok {
		return &ValidationError{Name: "estimated_cost", err: errors.New(`ent: missing required field "BatchImageJob.estimated_cost"`)}
	}
	if _, ok := _c.mutation.Currency(); !ok {
		return &ValidationError{Name: "currency", err: errors.New(`ent: missing required field "BatchImageJob.currency"`)}
	}
	if v, ok := _c.mutation.Currency(); ok {
		if err := batchimagejob.CurrencyValidator(v); err != nil {
			return &ValidationError{Name: "currency", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.currency": %w`, err)}
		}
	}
	if v, ok := _c.mutation.HoldID(); ok {
		if err := batchimagejob.HoldIDValidator(v); err != nil {
			return &ValidationError{Name: "hold_id", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.hold_id": %w`, err)}
		}
	}
	if v, ok := _c.mutation.IdempotencyKey(); ok {
		if err := batchimagejob.IdempotencyKeyValidator(v); err != nil {
			return &ValidationError{Name: "idempotency_key", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.idempotency_key": %w`, err)}
		}
	}
	if v, ok := _c.mutation.RequestHash(); ok {
		if err := batchimagejob.RequestHashValidator(v); err != nil {
			return &ValidationError{Name: "request_hash", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.request_hash": %w`, err)}
		}
	}
	if v, ok := _c.mutation.ManifestHash(); ok {
		if err := batchimagejob.ManifestHashValidator(v); err != nil {
			return &ValidationError{Name: "manifest_hash", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.manifest_hash": %w`, err)}
		}
	}
	if _, ok := _c.mutation.RetryCount(); !ok {
		return &ValidationError{Name: "retry_count", err: errors.New(`ent: missing required field "BatchImageJob.retry_count"`)}
	}
	if _, ok := _c.mutation.Version(); !ok {
		return &ValidationError{Name: "version", err: errors.New(`ent: missing required field "BatchImageJob.version"`)}
	}
	if v, ok := _c.mutation.LastErrorCode(); ok {
		if err := batchimagejob.LastErrorCodeValidator(v); err != nil {
			return &ValidationError{Name: "last_error_code", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.last_error_code": %w`, err)}
		}
	}
	if _, ok := _c.mutation.CreatedAt(); !ok {
		return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "BatchImageJob.created_at"`)}
	}
	if _, ok := _c.mutation.UpdatedAt(); !ok {
		return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "BatchImageJob.updated_at"`)}
	}
	return nil
}

func (_c *BatchImageJobCreate) sqlSave(ctx context.Context) (*BatchImageJob, error) {
	if err := _c.check(); err != nil {
		return nil, err
	}
	_node, _spec := _c.createSpec()
	if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil {
		if sqlgraph.IsConstraintError(err) {
			err = &ConstraintError{msg: err.Error(), wrap: err}
		}
		return nil, err
	}
	id := _spec.ID.Value.(int64)
	_node.ID = int64(id)
	_c.mutation.id = &_node.ID
	_c.mutation.done = true
	return _node, nil
}

func (_c *BatchImageJobCreate) createSpec() (*BatchImageJob, *sqlgraph.CreateSpec) {
	var (
		_node = &BatchImageJob{config: _c.config}
		_spec = sqlgraph.NewCreateSpec(batchimagejob.Table, sqlgraph.NewFieldSpec(batchimagejob.FieldID, field.TypeInt64))
	)
	_spec.OnConflict = _c.conflict
	if value, ok := _c.mutation.BatchID(); ok {
		_spec.SetField(batchimagejob.FieldBatchID, field.TypeString, value)
		_node.BatchID = value
	}
	if value, ok := _c.mutation.UserID(); ok {
		_spec.SetField(batchimagejob.FieldUserID, field.TypeInt64, value)
		_node.UserID = value
	}
	if value, ok := _c.mutation.APIKeyID(); ok {
		_spec.SetField(batchimagejob.FieldAPIKeyID, field.TypeInt64, value)
		_node.APIKeyID = &value
	}
	if value, ok := _c.mutation.AccountID(); ok {
		_spec.SetField(batchimagejob.FieldAccountID, field.TypeInt64, value)
		_node.AccountID = &value
	}
	if value, ok := _c.mutation.Provider(); ok {
		_spec.SetField(batchimagejob.FieldProvider, field.TypeString, value)
		_node.Provider = value
	}
	if value, ok := _c.mutation.Model(); ok {
		_spec.SetField(batchimagejob.FieldModel, field.TypeString, value)
		_node.Model = value
	}
	if value, ok := _c.mutation.TaskName(); ok {
		_spec.SetField(batchimagejob.FieldTaskName, field.TypeString, value)
		_node.TaskName = value
	}
	if value, ok := _c.mutation.Status(); ok {
		_spec.SetField(batchimagejob.FieldStatus, field.TypeString, value)
		_node.Status = value
	}
	if value, ok := _c.mutation.ProviderJobName(); ok {
		_spec.SetField(batchimagejob.FieldProviderJobName, field.TypeString, value)
		_node.ProviderJobName = &value
	}
	if value, ok := _c.mutation.ProviderInputRef(); ok {
		_spec.SetField(batchimagejob.FieldProviderInputRef, field.TypeString, value)
		_node.ProviderInputRef = &value
	}
	if value, ok := _c.mutation.ProviderOutputRef(); ok {
		_spec.SetField(batchimagejob.FieldProviderOutputRef, field.TypeString, value)
		_node.ProviderOutputRef = &value
	}
	if value, ok := _c.mutation.GcsInputURI(); ok {
		_spec.SetField(batchimagejob.FieldGcsInputURI, field.TypeString, value)
		_node.GcsInputURI = &value
	}
	if value, ok := _c.mutation.GcsOutputURI(); ok {
		_spec.SetField(batchimagejob.FieldGcsOutputURI, field.TypeString, value)
		_node.GcsOutputURI = &value
	}
	if value, ok := _c.mutation.ItemCount(); ok {
		_spec.SetField(batchimagejob.FieldItemCount, field.TypeInt, value)
		_node.ItemCount = value
	}
	if value, ok := _c.mutation.SuccessCount(); ok {
		_spec.SetField(batchimagejob.FieldSuccessCount, field.TypeInt, value)
		_node.SuccessCount = value
	}
	if value, ok := _c.mutation.FailCount(); ok {
		_spec.SetField(batchimagejob.FieldFailCount, field.TypeInt, value)
		_node.FailCount = value
	}
	if value, ok := _c.mutation.CancelledCount(); ok {
		_spec.SetField(batchimagejob.FieldCancelledCount, field.TypeInt, value)
		_node.CancelledCount = value
	}
	if value, ok := _c.mutation.EstimatedCost(); ok {
		_spec.SetField(batchimagejob.FieldEstimatedCost, field.TypeFloat64, value)
		_node.EstimatedCost = value
	}
	if value, ok := _c.mutation.HoldAmount(); ok {
		_spec.SetField(batchimagejob.FieldHoldAmount, field.TypeFloat64, value)
		_node.HoldAmount = &value
	}
	if value, ok := _c.mutation.ActualCost(); ok {
		_spec.SetField(batchimagejob.FieldActualCost, field.TypeFloat64, value)
		_node.ActualCost = &value
	}
	if value, ok := _c.mutation.Currency(); ok {
		_spec.SetField(batchimagejob.FieldCurrency, field.TypeString, value)
		_node.Currency = value
	}
	if value, ok := _c.mutation.HoldID(); ok {
		_spec.SetField(batchimagejob.FieldHoldID, field.TypeString, value)
		_node.HoldID = &value
	}
	if value, ok := _c.mutation.IdempotencyKey(); ok {
		_spec.SetField(batchimagejob.FieldIdempotencyKey, field.TypeString, value)
		_node.IdempotencyKey = &value
	}
	if value, ok := _c.mutation.RequestHash(); ok {
		_spec.SetField(batchimagejob.FieldRequestHash, field.TypeString, value)
		_node.RequestHash = &value
	}
	if value, ok := _c.mutation.ManifestHash(); ok {
		_spec.SetField(batchimagejob.FieldManifestHash, field.TypeString, value)
		_node.ManifestHash = &value
	}
	if value, ok := _c.mutation.RetryCount(); ok {
		_spec.SetField(batchimagejob.FieldRetryCount, field.TypeInt, value)
		_node.RetryCount = value
	}
	if value, ok := _c.mutation.Version(); ok {
		_spec.SetField(batchimagejob.FieldVersion, field.TypeInt, value)
		_node.Version = value
	}
	if value, ok := _c.mutation.OutputExpiresAt(); ok {
		_spec.SetField(batchimagejob.FieldOutputExpiresAt, field.TypeTime, value)
		_node.OutputExpiresAt = &value
	}
	if value, ok := _c.mutation.InputDeletedAt(); ok {
		_spec.SetField(batchimagejob.FieldInputDeletedAt, field.TypeTime, value)
		_node.InputDeletedAt = &value
	}
	if value, ok := _c.mutation.OutputDeletedAt(); ok {
		_spec.SetField(batchimagejob.FieldOutputDeletedAt, field.TypeTime, value)
		_node.OutputDeletedAt = &value
	}
	if value, ok := _c.mutation.DownloadedAt(); ok {
		_spec.SetField(batchimagejob.FieldDownloadedAt, field.TypeTime, value)
		_node.DownloadedAt = &value
	}
	if value, ok := _c.mutation.UserDeletedAt(); ok {
		_spec.SetField(batchimagejob.FieldUserDeletedAt, field.TypeTime, value)
		_node.UserDeletedAt = &value
	}
	if value, ok := _c.mutation.LastErrorCode(); ok {
		_spec.SetField(batchimagejob.FieldLastErrorCode, field.TypeString, value)
		_node.LastErrorCode = &value
	}
	if value, ok := _c.mutation.LastErrorMessage(); ok {
		_spec.SetField(batchimagejob.FieldLastErrorMessage, field.TypeString, value)
		_node.LastErrorMessage = &value
	}
	if value, ok := _c.mutation.CreatedAt(); ok {
		_spec.SetField(batchimagejob.FieldCreatedAt, field.TypeTime, value)
		_node.CreatedAt = value
	}
	if value, ok := _c.mutation.UpdatedAt(); ok {
		_spec.SetField(batchimagejob.FieldUpdatedAt, field.TypeTime, value)
		_node.UpdatedAt = value
	}
	if value, ok := _c.mutation.SubmittedAt(); ok {
		_spec.SetField(batchimagejob.FieldSubmittedAt, field.TypeTime, value)
		_node.SubmittedAt = &value
	}
	if value, ok := _c.mutation.StartedAt(); ok {
		_spec.SetField(batchimagejob.FieldStartedAt, field.TypeTime, value)
		_node.StartedAt = &value
	}
	if value, ok := _c.mutation.FinishedAt(); ok {
		_spec.SetField(batchimagejob.FieldFinishedAt, field.TypeTime, value)
		_node.FinishedAt = &value
	}
	if value, ok := _c.mutation.SettledAt(); ok {
		_spec.SetField(batchimagejob.FieldSettledAt, field.TypeTime, value)
		_node.SettledAt = &value
	}
	return _node, _spec
}

// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
// of the `INSERT` statement. For example:
//
//	client.BatchImageJob.Create().
//		SetBatchID(v).
//		OnConflict(
//			// Update the row with the new values
//			// the was proposed for insertion.
//			sql.ResolveWithNewValues(),
//		).
//		// Override some of the fields with custom
//		// update values.
//		Update(func(u *ent.BatchImageJobUpsert) {
//			SetBatchID(v+v).
//		}).
//		Exec(ctx)
func (_c *BatchImageJobCreate) OnConflict(opts ...sql.ConflictOption) *BatchImageJobUpsertOne {
	_c.conflict = opts
	return &BatchImageJobUpsertOne{
		create: _c,
	}
}

// OnConflictColumns calls `OnConflict` and configures the columns
// as conflict target. Using this option is equivalent to using:
//
//	client.BatchImageJob.Create().
//		OnConflict(sql.ConflictColumns(columns...)).
//		Exec(ctx)
func (_c *BatchImageJobCreate) OnConflictColumns(columns ...string) *BatchImageJobUpsertOne {
	_c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
	return &BatchImageJobUpsertOne{
		create: _c,
	}
}

type (
	// BatchImageJobUpsertOne is the builder for "upsert"-ing
	//  one BatchImageJob node.
	BatchImageJobUpsertOne struct {
		create *BatchImageJobCreate
	}

	// BatchImageJobUpsert is the "OnConflict" setter.
	BatchImageJobUpsert struct {
		*sql.UpdateSet
	}
)

// SetUserID sets the "user_id" field.
func (u *BatchImageJobUpsert) SetUserID(v int64) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldUserID, v)
	return u
}

// UpdateUserID sets the "user_id" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateUserID() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldUserID)
	return u
}

// AddUserID adds v to the "user_id" field.
func (u *BatchImageJobUpsert) AddUserID(v int64) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldUserID, v)
	return u
}

// SetAPIKeyID sets the "api_key_id" field.
func (u *BatchImageJobUpsert) SetAPIKeyID(v int64) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldAPIKeyID, v)
	return u
}

// UpdateAPIKeyID sets the "api_key_id" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateAPIKeyID() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldAPIKeyID)
	return u
}

// AddAPIKeyID adds v to the "api_key_id" field.
func (u *BatchImageJobUpsert) AddAPIKeyID(v int64) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldAPIKeyID, v)
	return u
}

// ClearAPIKeyID clears the value of the "api_key_id" field.
func (u *BatchImageJobUpsert) ClearAPIKeyID() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldAPIKeyID)
	return u
}

// SetAccountID sets the "account_id" field.
func (u *BatchImageJobUpsert) SetAccountID(v int64) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldAccountID, v)
	return u
}

// UpdateAccountID sets the "account_id" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateAccountID() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldAccountID)
	return u
}

// AddAccountID adds v to the "account_id" field.
func (u *BatchImageJobUpsert) AddAccountID(v int64) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldAccountID, v)
	return u
}

// ClearAccountID clears the value of the "account_id" field.
func (u *BatchImageJobUpsert) ClearAccountID() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldAccountID)
	return u
}

// SetProvider sets the "provider" field.
func (u *BatchImageJobUpsert) SetProvider(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldProvider, v)
	return u
}

// UpdateProvider sets the "provider" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateProvider() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldProvider)
	return u
}

// SetModel sets the "model" field.
func (u *BatchImageJobUpsert) SetModel(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldModel, v)
	return u
}

// UpdateModel sets the "model" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateModel() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldModel)
	return u
}

// SetTaskName sets the "task_name" field.
func (u *BatchImageJobUpsert) SetTaskName(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldTaskName, v)
	return u
}

// UpdateTaskName sets the "task_name" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateTaskName() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldTaskName)
	return u
}

// SetStatus sets the "status" field.
func (u *BatchImageJobUpsert) SetStatus(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldStatus, v)
	return u
}

// UpdateStatus sets the "status" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateStatus() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldStatus)
	return u
}

// SetProviderJobName sets the "provider_job_name" field.
func (u *BatchImageJobUpsert) SetProviderJobName(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldProviderJobName, v)
	return u
}

// UpdateProviderJobName sets the "provider_job_name" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateProviderJobName() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldProviderJobName)
	return u
}

// ClearProviderJobName clears the value of the "provider_job_name" field.
func (u *BatchImageJobUpsert) ClearProviderJobName() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldProviderJobName)
	return u
}

// SetProviderInputRef sets the "provider_input_ref" field.
func (u *BatchImageJobUpsert) SetProviderInputRef(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldProviderInputRef, v)
	return u
}

// UpdateProviderInputRef sets the "provider_input_ref" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateProviderInputRef() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldProviderInputRef)
	return u
}

// ClearProviderInputRef clears the value of the "provider_input_ref" field.
func (u *BatchImageJobUpsert) ClearProviderInputRef() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldProviderInputRef)
	return u
}

// SetProviderOutputRef sets the "provider_output_ref" field.
func (u *BatchImageJobUpsert) SetProviderOutputRef(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldProviderOutputRef, v)
	return u
}

// UpdateProviderOutputRef sets the "provider_output_ref" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateProviderOutputRef() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldProviderOutputRef)
	return u
}

// ClearProviderOutputRef clears the value of the "provider_output_ref" field.
func (u *BatchImageJobUpsert) ClearProviderOutputRef() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldProviderOutputRef)
	return u
}

// SetGcsInputURI sets the "gcs_input_uri" field.
func (u *BatchImageJobUpsert) SetGcsInputURI(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldGcsInputURI, v)
	return u
}

// UpdateGcsInputURI sets the "gcs_input_uri" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateGcsInputURI() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldGcsInputURI)
	return u
}

// ClearGcsInputURI clears the value of the "gcs_input_uri" field.
func (u *BatchImageJobUpsert) ClearGcsInputURI() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldGcsInputURI)
	return u
}

// SetGcsOutputURI sets the "gcs_output_uri" field.
func (u *BatchImageJobUpsert) SetGcsOutputURI(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldGcsOutputURI, v)
	return u
}

// UpdateGcsOutputURI sets the "gcs_output_uri" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateGcsOutputURI() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldGcsOutputURI)
	return u
}

// ClearGcsOutputURI clears the value of the "gcs_output_uri" field.
func (u *BatchImageJobUpsert) ClearGcsOutputURI() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldGcsOutputURI)
	return u
}

// SetItemCount sets the "item_count" field.
func (u *BatchImageJobUpsert) SetItemCount(v int) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldItemCount, v)
	return u
}

// UpdateItemCount sets the "item_count" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateItemCount() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldItemCount)
	return u
}

// AddItemCount adds v to the "item_count" field.
func (u *BatchImageJobUpsert) AddItemCount(v int) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldItemCount, v)
	return u
}

// SetSuccessCount sets the "success_count" field.
func (u *BatchImageJobUpsert) SetSuccessCount(v int) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldSuccessCount, v)
	return u
}

// UpdateSuccessCount sets the "success_count" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateSuccessCount() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldSuccessCount)
	return u
}

// AddSuccessCount adds v to the "success_count" field.
func (u *BatchImageJobUpsert) AddSuccessCount(v int) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldSuccessCount, v)
	return u
}

// SetFailCount sets the "fail_count" field.
func (u *BatchImageJobUpsert) SetFailCount(v int) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldFailCount, v)
	return u
}

// UpdateFailCount sets the "fail_count" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateFailCount() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldFailCount)
	return u
}

// AddFailCount adds v to the "fail_count" field.
func (u *BatchImageJobUpsert) AddFailCount(v int) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldFailCount, v)
	return u
}

// SetCancelledCount sets the "cancelled_count" field.
func (u *BatchImageJobUpsert) SetCancelledCount(v int) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldCancelledCount, v)
	return u
}

// UpdateCancelledCount sets the "cancelled_count" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateCancelledCount() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldCancelledCount)
	return u
}

// AddCancelledCount adds v to the "cancelled_count" field.
func (u *BatchImageJobUpsert) AddCancelledCount(v int) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldCancelledCount, v)
	return u
}

// SetEstimatedCost sets the "estimated_cost" field.
func (u *BatchImageJobUpsert) SetEstimatedCost(v float64) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldEstimatedCost, v)
	return u
}

// UpdateEstimatedCost sets the "estimated_cost" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateEstimatedCost() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldEstimatedCost)
	return u
}

// AddEstimatedCost adds v to the "estimated_cost" field.
func (u *BatchImageJobUpsert) AddEstimatedCost(v float64) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldEstimatedCost, v)
	return u
}

// SetHoldAmount sets the "hold_amount" field.
func (u *BatchImageJobUpsert) SetHoldAmount(v float64) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldHoldAmount, v)
	return u
}

// UpdateHoldAmount sets the "hold_amount" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateHoldAmount() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldHoldAmount)
	return u
}

// AddHoldAmount adds v to the "hold_amount" field.
func (u *BatchImageJobUpsert) AddHoldAmount(v float64) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldHoldAmount, v)
	return u
}

// ClearHoldAmount clears the value of the "hold_amount" field.
func (u *BatchImageJobUpsert) ClearHoldAmount() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldHoldAmount)
	return u
}

// SetActualCost sets the "actual_cost" field.
func (u *BatchImageJobUpsert) SetActualCost(v float64) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldActualCost, v)
	return u
}

// UpdateActualCost sets the "actual_cost" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateActualCost() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldActualCost)
	return u
}

// AddActualCost adds v to the "actual_cost" field.
func (u *BatchImageJobUpsert) AddActualCost(v float64) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldActualCost, v)
	return u
}

// ClearActualCost clears the value of the "actual_cost" field.
func (u *BatchImageJobUpsert) ClearActualCost() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldActualCost)
	return u
}

// SetCurrency sets the "currency" field.
func (u *BatchImageJobUpsert) SetCurrency(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldCurrency, v)
	return u
}

// UpdateCurrency sets the "currency" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateCurrency() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldCurrency)
	return u
}

// SetHoldID sets the "hold_id" field.
func (u *BatchImageJobUpsert) SetHoldID(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldHoldID, v)
	return u
}

// UpdateHoldID sets the "hold_id" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateHoldID() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldHoldID)
	return u
}

// ClearHoldID clears the value of the "hold_id" field.
func (u *BatchImageJobUpsert) ClearHoldID() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldHoldID)
	return u
}

// SetIdempotencyKey sets the "idempotency_key" field.
func (u *BatchImageJobUpsert) SetIdempotencyKey(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldIdempotencyKey, v)
	return u
}

// UpdateIdempotencyKey sets the "idempotency_key" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateIdempotencyKey() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldIdempotencyKey)
	return u
}

// ClearIdempotencyKey clears the value of the "idempotency_key" field.
func (u *BatchImageJobUpsert) ClearIdempotencyKey() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldIdempotencyKey)
	return u
}

// SetRequestHash sets the "request_hash" field.
func (u *BatchImageJobUpsert) SetRequestHash(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldRequestHash, v)
	return u
}

// UpdateRequestHash sets the "request_hash" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateRequestHash() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldRequestHash)
	return u
}

// ClearRequestHash clears the value of the "request_hash" field.
func (u *BatchImageJobUpsert) ClearRequestHash() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldRequestHash)
	return u
}

// SetManifestHash sets the "manifest_hash" field.
func (u *BatchImageJobUpsert) SetManifestHash(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldManifestHash, v)
	return u
}

// UpdateManifestHash sets the "manifest_hash" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateManifestHash() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldManifestHash)
	return u
}

// ClearManifestHash clears the value of the "manifest_hash" field.
func (u *BatchImageJobUpsert) ClearManifestHash() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldManifestHash)
	return u
}

// SetRetryCount sets the "retry_count" field.
func (u *BatchImageJobUpsert) SetRetryCount(v int) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldRetryCount, v)
	return u
}

// UpdateRetryCount sets the "retry_count" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateRetryCount() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldRetryCount)
	return u
}

// AddRetryCount adds v to the "retry_count" field.
func (u *BatchImageJobUpsert) AddRetryCount(v int) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldRetryCount, v)
	return u
}

// SetVersion sets the "version" field.
func (u *BatchImageJobUpsert) SetVersion(v int) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldVersion, v)
	return u
}

// UpdateVersion sets the "version" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateVersion() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldVersion)
	return u
}

// AddVersion adds v to the "version" field.
func (u *BatchImageJobUpsert) AddVersion(v int) *BatchImageJobUpsert {
	u.Add(batchimagejob.FieldVersion, v)
	return u
}

// SetOutputExpiresAt sets the "output_expires_at" field.
func (u *BatchImageJobUpsert) SetOutputExpiresAt(v time.Time) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldOutputExpiresAt, v)
	return u
}

// UpdateOutputExpiresAt sets the "output_expires_at" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateOutputExpiresAt() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldOutputExpiresAt)
	return u
}

// ClearOutputExpiresAt clears the value of the "output_expires_at" field.
func (u *BatchImageJobUpsert) ClearOutputExpiresAt() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldOutputExpiresAt)
	return u
}

// SetInputDeletedAt sets the "input_deleted_at" field.
func (u *BatchImageJobUpsert) SetInputDeletedAt(v time.Time) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldInputDeletedAt, v)
	return u
}

// UpdateInputDeletedAt sets the "input_deleted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateInputDeletedAt() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldInputDeletedAt)
	return u
}

// ClearInputDeletedAt clears the value of the "input_deleted_at" field.
func (u *BatchImageJobUpsert) ClearInputDeletedAt() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldInputDeletedAt)
	return u
}

// SetOutputDeletedAt sets the "output_deleted_at" field.
func (u *BatchImageJobUpsert) SetOutputDeletedAt(v time.Time) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldOutputDeletedAt, v)
	return u
}

// UpdateOutputDeletedAt sets the "output_deleted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateOutputDeletedAt() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldOutputDeletedAt)
	return u
}

// ClearOutputDeletedAt clears the value of the "output_deleted_at" field.
func (u *BatchImageJobUpsert) ClearOutputDeletedAt() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldOutputDeletedAt)
	return u
}

// SetDownloadedAt sets the "downloaded_at" field.
func (u *BatchImageJobUpsert) SetDownloadedAt(v time.Time) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldDownloadedAt, v)
	return u
}

// UpdateDownloadedAt sets the "downloaded_at" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateDownloadedAt() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldDownloadedAt)
	return u
}

// ClearDownloadedAt clears the value of the "downloaded_at" field.
func (u *BatchImageJobUpsert) ClearDownloadedAt() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldDownloadedAt)
	return u
}

// SetUserDeletedAt sets the "user_deleted_at" field.
func (u *BatchImageJobUpsert) SetUserDeletedAt(v time.Time) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldUserDeletedAt, v)
	return u
}

// UpdateUserDeletedAt sets the "user_deleted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateUserDeletedAt() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldUserDeletedAt)
	return u
}

// ClearUserDeletedAt clears the value of the "user_deleted_at" field.
func (u *BatchImageJobUpsert) ClearUserDeletedAt() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldUserDeletedAt)
	return u
}

// SetLastErrorCode sets the "last_error_code" field.
func (u *BatchImageJobUpsert) SetLastErrorCode(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldLastErrorCode, v)
	return u
}

// UpdateLastErrorCode sets the "last_error_code" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateLastErrorCode() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldLastErrorCode)
	return u
}

// ClearLastErrorCode clears the value of the "last_error_code" field.
func (u *BatchImageJobUpsert) ClearLastErrorCode() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldLastErrorCode)
	return u
}

// SetLastErrorMessage sets the "last_error_message" field.
func (u *BatchImageJobUpsert) SetLastErrorMessage(v string) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldLastErrorMessage, v)
	return u
}

// UpdateLastErrorMessage sets the "last_error_message" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateLastErrorMessage() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldLastErrorMessage)
	return u
}

// ClearLastErrorMessage clears the value of the "last_error_message" field.
func (u *BatchImageJobUpsert) ClearLastErrorMessage() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldLastErrorMessage)
	return u
}

// SetUpdatedAt sets the "updated_at" field.
func (u *BatchImageJobUpsert) SetUpdatedAt(v time.Time) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldUpdatedAt, v)
	return u
}

// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateUpdatedAt() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldUpdatedAt)
	return u
}

// SetSubmittedAt sets the "submitted_at" field.
func (u *BatchImageJobUpsert) SetSubmittedAt(v time.Time) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldSubmittedAt, v)
	return u
}

// UpdateSubmittedAt sets the "submitted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateSubmittedAt() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldSubmittedAt)
	return u
}

// ClearSubmittedAt clears the value of the "submitted_at" field.
func (u *BatchImageJobUpsert) ClearSubmittedAt() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldSubmittedAt)
	return u
}

// SetStartedAt sets the "started_at" field.
func (u *BatchImageJobUpsert) SetStartedAt(v time.Time) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldStartedAt, v)
	return u
}

// UpdateStartedAt sets the "started_at" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateStartedAt() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldStartedAt)
	return u
}

// ClearStartedAt clears the value of the "started_at" field.
func (u *BatchImageJobUpsert) ClearStartedAt() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldStartedAt)
	return u
}

// SetFinishedAt sets the "finished_at" field.
func (u *BatchImageJobUpsert) SetFinishedAt(v time.Time) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldFinishedAt, v)
	return u
}

// UpdateFinishedAt sets the "finished_at" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateFinishedAt() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldFinishedAt)
	return u
}

// ClearFinishedAt clears the value of the "finished_at" field.
func (u *BatchImageJobUpsert) ClearFinishedAt() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldFinishedAt)
	return u
}

// SetSettledAt sets the "settled_at" field.
func (u *BatchImageJobUpsert) SetSettledAt(v time.Time) *BatchImageJobUpsert {
	u.Set(batchimagejob.FieldSettledAt, v)
	return u
}

// UpdateSettledAt sets the "settled_at" field to the value that was provided on create.
func (u *BatchImageJobUpsert) UpdateSettledAt() *BatchImageJobUpsert {
	u.SetExcluded(batchimagejob.FieldSettledAt)
	return u
}

// ClearSettledAt clears the value of the "settled_at" field.
func (u *BatchImageJobUpsert) ClearSettledAt() *BatchImageJobUpsert {
	u.SetNull(batchimagejob.FieldSettledAt)
	return u
}

// UpdateNewValues updates the mutable fields using the new values that were set on create.
// Using this option is equivalent to using:
//
//	client.BatchImageJob.Create().
//		OnConflict(
//			sql.ResolveWithNewValues(),
//		).
//		Exec(ctx)
func (u *BatchImageJobUpsertOne) UpdateNewValues() *BatchImageJobUpsertOne {
	u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
		if _, exists := u.create.mutation.BatchID(); exists {
			s.SetIgnore(batchimagejob.FieldBatchID)
		}
		if _, exists := u.create.mutation.CreatedAt(); exists {
			s.SetIgnore(batchimagejob.FieldCreatedAt)
		}
	}))
	return u
}

// Ignore sets each column to itself in case of conflict.
// Using this option is equivalent to using:
//
//	client.BatchImageJob.Create().
//	    OnConflict(sql.ResolveWithIgnore()).
//	    Exec(ctx)
func (u *BatchImageJobUpsertOne) Ignore() *BatchImageJobUpsertOne {
	u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
	return u
}

// DoNothing configures the conflict_action to `DO NOTHING`.
// Supported only by SQLite and PostgreSQL.
func (u *BatchImageJobUpsertOne) DoNothing() *BatchImageJobUpsertOne {
	u.create.conflict = append(u.create.conflict, sql.DoNothing())
	return u
}

// Update allows overriding fields `UPDATE` values. See the BatchImageJobCreate.OnConflict
// documentation for more info.
func (u *BatchImageJobUpsertOne) Update(set func(*BatchImageJobUpsert)) *BatchImageJobUpsertOne {
	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
		set(&BatchImageJobUpsert{UpdateSet: update})
	}))
	return u
}

// SetUserID sets the "user_id" field.
func (u *BatchImageJobUpsertOne) SetUserID(v int64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetUserID(v)
	})
}

// AddUserID adds v to the "user_id" field.
func (u *BatchImageJobUpsertOne) AddUserID(v int64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddUserID(v)
	})
}

// UpdateUserID sets the "user_id" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateUserID() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateUserID()
	})
}

// SetAPIKeyID sets the "api_key_id" field.
func (u *BatchImageJobUpsertOne) SetAPIKeyID(v int64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetAPIKeyID(v)
	})
}

// AddAPIKeyID adds v to the "api_key_id" field.
func (u *BatchImageJobUpsertOne) AddAPIKeyID(v int64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddAPIKeyID(v)
	})
}

// UpdateAPIKeyID sets the "api_key_id" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateAPIKeyID() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateAPIKeyID()
	})
}

// ClearAPIKeyID clears the value of the "api_key_id" field.
func (u *BatchImageJobUpsertOne) ClearAPIKeyID() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearAPIKeyID()
	})
}

// SetAccountID sets the "account_id" field.
func (u *BatchImageJobUpsertOne) SetAccountID(v int64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetAccountID(v)
	})
}

// AddAccountID adds v to the "account_id" field.
func (u *BatchImageJobUpsertOne) AddAccountID(v int64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddAccountID(v)
	})
}

// UpdateAccountID sets the "account_id" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateAccountID() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateAccountID()
	})
}

// ClearAccountID clears the value of the "account_id" field.
func (u *BatchImageJobUpsertOne) ClearAccountID() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearAccountID()
	})
}

// SetProvider sets the "provider" field.
func (u *BatchImageJobUpsertOne) SetProvider(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetProvider(v)
	})
}

// UpdateProvider sets the "provider" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateProvider() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateProvider()
	})
}

// SetModel sets the "model" field.
func (u *BatchImageJobUpsertOne) SetModel(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetModel(v)
	})
}

// UpdateModel sets the "model" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateModel() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateModel()
	})
}

// SetTaskName sets the "task_name" field.
func (u *BatchImageJobUpsertOne) SetTaskName(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetTaskName(v)
	})
}

// UpdateTaskName sets the "task_name" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateTaskName() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateTaskName()
	})
}

// SetStatus sets the "status" field.
func (u *BatchImageJobUpsertOne) SetStatus(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetStatus(v)
	})
}

// UpdateStatus sets the "status" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateStatus() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateStatus()
	})
}

// SetProviderJobName sets the "provider_job_name" field.
func (u *BatchImageJobUpsertOne) SetProviderJobName(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetProviderJobName(v)
	})
}

// UpdateProviderJobName sets the "provider_job_name" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateProviderJobName() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateProviderJobName()
	})
}

// ClearProviderJobName clears the value of the "provider_job_name" field.
func (u *BatchImageJobUpsertOne) ClearProviderJobName() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearProviderJobName()
	})
}

// SetProviderInputRef sets the "provider_input_ref" field.
func (u *BatchImageJobUpsertOne) SetProviderInputRef(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetProviderInputRef(v)
	})
}

// UpdateProviderInputRef sets the "provider_input_ref" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateProviderInputRef() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateProviderInputRef()
	})
}

// ClearProviderInputRef clears the value of the "provider_input_ref" field.
func (u *BatchImageJobUpsertOne) ClearProviderInputRef() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearProviderInputRef()
	})
}

// SetProviderOutputRef sets the "provider_output_ref" field.
func (u *BatchImageJobUpsertOne) SetProviderOutputRef(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetProviderOutputRef(v)
	})
}

// UpdateProviderOutputRef sets the "provider_output_ref" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateProviderOutputRef() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateProviderOutputRef()
	})
}

// ClearProviderOutputRef clears the value of the "provider_output_ref" field.
func (u *BatchImageJobUpsertOne) ClearProviderOutputRef() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearProviderOutputRef()
	})
}

// SetGcsInputURI sets the "gcs_input_uri" field.
func (u *BatchImageJobUpsertOne) SetGcsInputURI(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetGcsInputURI(v)
	})
}

// UpdateGcsInputURI sets the "gcs_input_uri" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateGcsInputURI() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateGcsInputURI()
	})
}

// ClearGcsInputURI clears the value of the "gcs_input_uri" field.
func (u *BatchImageJobUpsertOne) ClearGcsInputURI() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearGcsInputURI()
	})
}

// SetGcsOutputURI sets the "gcs_output_uri" field.
func (u *BatchImageJobUpsertOne) SetGcsOutputURI(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetGcsOutputURI(v)
	})
}

// UpdateGcsOutputURI sets the "gcs_output_uri" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateGcsOutputURI() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateGcsOutputURI()
	})
}

// ClearGcsOutputURI clears the value of the "gcs_output_uri" field.
func (u *BatchImageJobUpsertOne) ClearGcsOutputURI() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearGcsOutputURI()
	})
}

// SetItemCount sets the "item_count" field.
func (u *BatchImageJobUpsertOne) SetItemCount(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetItemCount(v)
	})
}

// AddItemCount adds v to the "item_count" field.
func (u *BatchImageJobUpsertOne) AddItemCount(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddItemCount(v)
	})
}

// UpdateItemCount sets the "item_count" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateItemCount() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateItemCount()
	})
}

// SetSuccessCount sets the "success_count" field.
func (u *BatchImageJobUpsertOne) SetSuccessCount(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetSuccessCount(v)
	})
}

// AddSuccessCount adds v to the "success_count" field.
func (u *BatchImageJobUpsertOne) AddSuccessCount(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddSuccessCount(v)
	})
}

// UpdateSuccessCount sets the "success_count" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateSuccessCount() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateSuccessCount()
	})
}

// SetFailCount sets the "fail_count" field.
func (u *BatchImageJobUpsertOne) SetFailCount(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetFailCount(v)
	})
}

// AddFailCount adds v to the "fail_count" field.
func (u *BatchImageJobUpsertOne) AddFailCount(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddFailCount(v)
	})
}

// UpdateFailCount sets the "fail_count" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateFailCount() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateFailCount()
	})
}

// SetCancelledCount sets the "cancelled_count" field.
func (u *BatchImageJobUpsertOne) SetCancelledCount(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetCancelledCount(v)
	})
}

// AddCancelledCount adds v to the "cancelled_count" field.
func (u *BatchImageJobUpsertOne) AddCancelledCount(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddCancelledCount(v)
	})
}

// UpdateCancelledCount sets the "cancelled_count" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateCancelledCount() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateCancelledCount()
	})
}

// SetEstimatedCost sets the "estimated_cost" field.
func (u *BatchImageJobUpsertOne) SetEstimatedCost(v float64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetEstimatedCost(v)
	})
}

// AddEstimatedCost adds v to the "estimated_cost" field.
func (u *BatchImageJobUpsertOne) AddEstimatedCost(v float64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddEstimatedCost(v)
	})
}

// UpdateEstimatedCost sets the "estimated_cost" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateEstimatedCost() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateEstimatedCost()
	})
}

// SetHoldAmount sets the "hold_amount" field.
func (u *BatchImageJobUpsertOne) SetHoldAmount(v float64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetHoldAmount(v)
	})
}

// AddHoldAmount adds v to the "hold_amount" field.
func (u *BatchImageJobUpsertOne) AddHoldAmount(v float64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddHoldAmount(v)
	})
}

// UpdateHoldAmount sets the "hold_amount" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateHoldAmount() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateHoldAmount()
	})
}

// ClearHoldAmount clears the value of the "hold_amount" field.
func (u *BatchImageJobUpsertOne) ClearHoldAmount() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearHoldAmount()
	})
}

// SetActualCost sets the "actual_cost" field.
func (u *BatchImageJobUpsertOne) SetActualCost(v float64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetActualCost(v)
	})
}

// AddActualCost adds v to the "actual_cost" field.
func (u *BatchImageJobUpsertOne) AddActualCost(v float64) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddActualCost(v)
	})
}

// UpdateActualCost sets the "actual_cost" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateActualCost() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateActualCost()
	})
}

// ClearActualCost clears the value of the "actual_cost" field.
func (u *BatchImageJobUpsertOne) ClearActualCost() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearActualCost()
	})
}

// SetCurrency sets the "currency" field.
func (u *BatchImageJobUpsertOne) SetCurrency(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetCurrency(v)
	})
}

// UpdateCurrency sets the "currency" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateCurrency() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateCurrency()
	})
}

// SetHoldID sets the "hold_id" field.
func (u *BatchImageJobUpsertOne) SetHoldID(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetHoldID(v)
	})
}

// UpdateHoldID sets the "hold_id" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateHoldID() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateHoldID()
	})
}

// ClearHoldID clears the value of the "hold_id" field.
func (u *BatchImageJobUpsertOne) ClearHoldID() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearHoldID()
	})
}

// SetIdempotencyKey sets the "idempotency_key" field.
func (u *BatchImageJobUpsertOne) SetIdempotencyKey(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetIdempotencyKey(v)
	})
}

// UpdateIdempotencyKey sets the "idempotency_key" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateIdempotencyKey() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateIdempotencyKey()
	})
}

// ClearIdempotencyKey clears the value of the "idempotency_key" field.
func (u *BatchImageJobUpsertOne) ClearIdempotencyKey() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearIdempotencyKey()
	})
}

// SetRequestHash sets the "request_hash" field.
func (u *BatchImageJobUpsertOne) SetRequestHash(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetRequestHash(v)
	})
}

// UpdateRequestHash sets the "request_hash" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateRequestHash() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateRequestHash()
	})
}

// ClearRequestHash clears the value of the "request_hash" field.
func (u *BatchImageJobUpsertOne) ClearRequestHash() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearRequestHash()
	})
}

// SetManifestHash sets the "manifest_hash" field.
func (u *BatchImageJobUpsertOne) SetManifestHash(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetManifestHash(v)
	})
}

// UpdateManifestHash sets the "manifest_hash" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateManifestHash() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateManifestHash()
	})
}

// ClearManifestHash clears the value of the "manifest_hash" field.
func (u *BatchImageJobUpsertOne) ClearManifestHash() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearManifestHash()
	})
}

// SetRetryCount sets the "retry_count" field.
func (u *BatchImageJobUpsertOne) SetRetryCount(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetRetryCount(v)
	})
}

// AddRetryCount adds v to the "retry_count" field.
func (u *BatchImageJobUpsertOne) AddRetryCount(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddRetryCount(v)
	})
}

// UpdateRetryCount sets the "retry_count" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateRetryCount() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateRetryCount()
	})
}

// SetVersion sets the "version" field.
func (u *BatchImageJobUpsertOne) SetVersion(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetVersion(v)
	})
}

// AddVersion adds v to the "version" field.
func (u *BatchImageJobUpsertOne) AddVersion(v int) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddVersion(v)
	})
}

// UpdateVersion sets the "version" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateVersion() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateVersion()
	})
}

// SetOutputExpiresAt sets the "output_expires_at" field.
func (u *BatchImageJobUpsertOne) SetOutputExpiresAt(v time.Time) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetOutputExpiresAt(v)
	})
}

// UpdateOutputExpiresAt sets the "output_expires_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateOutputExpiresAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateOutputExpiresAt()
	})
}

// ClearOutputExpiresAt clears the value of the "output_expires_at" field.
func (u *BatchImageJobUpsertOne) ClearOutputExpiresAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearOutputExpiresAt()
	})
}

// SetInputDeletedAt sets the "input_deleted_at" field.
func (u *BatchImageJobUpsertOne) SetInputDeletedAt(v time.Time) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetInputDeletedAt(v)
	})
}

// UpdateInputDeletedAt sets the "input_deleted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateInputDeletedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateInputDeletedAt()
	})
}

// ClearInputDeletedAt clears the value of the "input_deleted_at" field.
func (u *BatchImageJobUpsertOne) ClearInputDeletedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearInputDeletedAt()
	})
}

// SetOutputDeletedAt sets the "output_deleted_at" field.
func (u *BatchImageJobUpsertOne) SetOutputDeletedAt(v time.Time) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetOutputDeletedAt(v)
	})
}

// UpdateOutputDeletedAt sets the "output_deleted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateOutputDeletedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateOutputDeletedAt()
	})
}

// ClearOutputDeletedAt clears the value of the "output_deleted_at" field.
func (u *BatchImageJobUpsertOne) ClearOutputDeletedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearOutputDeletedAt()
	})
}

// SetDownloadedAt sets the "downloaded_at" field.
func (u *BatchImageJobUpsertOne) SetDownloadedAt(v time.Time) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetDownloadedAt(v)
	})
}

// UpdateDownloadedAt sets the "downloaded_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateDownloadedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateDownloadedAt()
	})
}

// ClearDownloadedAt clears the value of the "downloaded_at" field.
func (u *BatchImageJobUpsertOne) ClearDownloadedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearDownloadedAt()
	})
}

// SetUserDeletedAt sets the "user_deleted_at" field.
func (u *BatchImageJobUpsertOne) SetUserDeletedAt(v time.Time) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetUserDeletedAt(v)
	})
}

// UpdateUserDeletedAt sets the "user_deleted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateUserDeletedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateUserDeletedAt()
	})
}

// ClearUserDeletedAt clears the value of the "user_deleted_at" field.
func (u *BatchImageJobUpsertOne) ClearUserDeletedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearUserDeletedAt()
	})
}

// SetLastErrorCode sets the "last_error_code" field.
func (u *BatchImageJobUpsertOne) SetLastErrorCode(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetLastErrorCode(v)
	})
}

// UpdateLastErrorCode sets the "last_error_code" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateLastErrorCode() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateLastErrorCode()
	})
}

// ClearLastErrorCode clears the value of the "last_error_code" field.
func (u *BatchImageJobUpsertOne) ClearLastErrorCode() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearLastErrorCode()
	})
}

// SetLastErrorMessage sets the "last_error_message" field.
func (u *BatchImageJobUpsertOne) SetLastErrorMessage(v string) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetLastErrorMessage(v)
	})
}

// UpdateLastErrorMessage sets the "last_error_message" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateLastErrorMessage() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateLastErrorMessage()
	})
}

// ClearLastErrorMessage clears the value of the "last_error_message" field.
func (u *BatchImageJobUpsertOne) ClearLastErrorMessage() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearLastErrorMessage()
	})
}

// SetUpdatedAt sets the "updated_at" field.
func (u *BatchImageJobUpsertOne) SetUpdatedAt(v time.Time) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetUpdatedAt(v)
	})
}

// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateUpdatedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateUpdatedAt()
	})
}

// SetSubmittedAt sets the "submitted_at" field.
func (u *BatchImageJobUpsertOne) SetSubmittedAt(v time.Time) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetSubmittedAt(v)
	})
}

// UpdateSubmittedAt sets the "submitted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateSubmittedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateSubmittedAt()
	})
}

// ClearSubmittedAt clears the value of the "submitted_at" field.
func (u *BatchImageJobUpsertOne) ClearSubmittedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearSubmittedAt()
	})
}

// SetStartedAt sets the "started_at" field.
func (u *BatchImageJobUpsertOne) SetStartedAt(v time.Time) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetStartedAt(v)
	})
}

// UpdateStartedAt sets the "started_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateStartedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateStartedAt()
	})
}

// ClearStartedAt clears the value of the "started_at" field.
func (u *BatchImageJobUpsertOne) ClearStartedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearStartedAt()
	})
}

// SetFinishedAt sets the "finished_at" field.
func (u *BatchImageJobUpsertOne) SetFinishedAt(v time.Time) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetFinishedAt(v)
	})
}

// UpdateFinishedAt sets the "finished_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateFinishedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateFinishedAt()
	})
}

// ClearFinishedAt clears the value of the "finished_at" field.
func (u *BatchImageJobUpsertOne) ClearFinishedAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearFinishedAt()
	})
}

// SetSettledAt sets the "settled_at" field.
func (u *BatchImageJobUpsertOne) SetSettledAt(v time.Time) *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetSettledAt(v)
	})
}

// UpdateSettledAt sets the "settled_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertOne) UpdateSettledAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateSettledAt()
	})
}

// ClearSettledAt clears the value of the "settled_at" field.
func (u *BatchImageJobUpsertOne) ClearSettledAt() *BatchImageJobUpsertOne {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearSettledAt()
	})
}

// Exec executes the query.
func (u *BatchImageJobUpsertOne) Exec(ctx context.Context) error {
	if len(u.create.conflict) == 0 {
		return errors.New("ent: missing options for BatchImageJobCreate.OnConflict")
	}
	return u.create.Exec(ctx)
}

// ExecX is like Exec, but panics if an error occurs.
func (u *BatchImageJobUpsertOne) ExecX(ctx context.Context) {
	if err := u.create.Exec(ctx); err != nil {
		panic(err)
	}
}

// Exec executes the UPSERT query and returns the inserted/updated ID.
func (u *BatchImageJobUpsertOne) ID(ctx context.Context) (id int64, err error) {
	node, err := u.create.Save(ctx)
	if err != nil {
		return id, err
	}
	return node.ID, nil
}

// IDX is like ID, but panics if an error occurs.
func (u *BatchImageJobUpsertOne) IDX(ctx context.Context) int64 {
	id, err := u.ID(ctx)
	if err != nil {
		panic(err)
	}
	return id
}

// BatchImageJobCreateBulk is the builder for creating many BatchImageJob entities in bulk.
type BatchImageJobCreateBulk struct {
	config
	err      error
	builders []*BatchImageJobCreate
	conflict []sql.ConflictOption
}

// Save creates the BatchImageJob entities in the database.
func (_c *BatchImageJobCreateBulk) Save(ctx context.Context) ([]*BatchImageJob, error) {
	if _c.err != nil {
		return nil, _c.err
	}
	specs := make([]*sqlgraph.CreateSpec, len(_c.builders))
	nodes := make([]*BatchImageJob, len(_c.builders))
	mutators := make([]Mutator, len(_c.builders))
	for i := range _c.builders {
		func(i int, root context.Context) {
			builder := _c.builders[i]
			builder.defaults()
			var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
				mutation, ok := m.(*BatchImageJobMutation)
				if !ok {
					return nil, fmt.Errorf("unexpected mutation type %T", m)
				}
				if err := builder.check(); err != nil {
					return nil, err
				}
				builder.mutation = mutation
				var err error
				nodes[i], specs[i] = builder.createSpec()
				if i < len(mutators)-1 {
					_, err = mutators[i+1].Mutate(root, _c.builders[i+1].mutation)
				} else {
					spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
					spec.OnConflict = _c.conflict
					// Invoke the actual operation on the latest mutation in the chain.
					if err = sqlgraph.BatchCreate(ctx, _c.driver, spec); err != nil {
						if sqlgraph.IsConstraintError(err) {
							err = &ConstraintError{msg: err.Error(), wrap: err}
						}
					}
				}
				if err != nil {
					return nil, err
				}
				mutation.id = &nodes[i].ID
				if specs[i].ID.Value != nil {
					id := specs[i].ID.Value.(int64)
					nodes[i].ID = int64(id)
				}
				mutation.done = true
				return nodes[i], nil
			})
			for i := len(builder.hooks) - 1; i >= 0; i-- {
				mut = builder.hooks[i](mut)
			}
			mutators[i] = mut
		}(i, ctx)
	}
	if len(mutators) > 0 {
		if _, err := mutators[0].Mutate(ctx, _c.builders[0].mutation); err != nil {
			return nil, err
		}
	}
	return nodes, nil
}

// SaveX is like Save, but panics if an error occurs.
func (_c *BatchImageJobCreateBulk) SaveX(ctx context.Context) []*BatchImageJob {
	v, err := _c.Save(ctx)
	if err != nil {
		panic(err)
	}
	return v
}

// Exec executes the query.
func (_c *BatchImageJobCreateBulk) Exec(ctx context.Context) error {
	_, err := _c.Save(ctx)
	return err
}

// ExecX is like Exec, but panics if an error occurs.
func (_c *BatchImageJobCreateBulk) ExecX(ctx context.Context) {
	if err := _c.Exec(ctx); err != nil {
		panic(err)
	}
}

// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
// of the `INSERT` statement. For example:
//
//	client.BatchImageJob.CreateBulk(builders...).
//		OnConflict(
//			// Update the row with the new values
//			// the was proposed for insertion.
//			sql.ResolveWithNewValues(),
//		).
//		// Override some of the fields with custom
//		// update values.
//		Update(func(u *ent.BatchImageJobUpsert) {
//			SetBatchID(v+v).
//		}).
//		Exec(ctx)
func (_c *BatchImageJobCreateBulk) OnConflict(opts ...sql.ConflictOption) *BatchImageJobUpsertBulk {
	_c.conflict = opts
	return &BatchImageJobUpsertBulk{
		create: _c,
	}
}

// OnConflictColumns calls `OnConflict` and configures the columns
// as conflict target. Using this option is equivalent to using:
//
//	client.BatchImageJob.Create().
//		OnConflict(sql.ConflictColumns(columns...)).
//		Exec(ctx)
func (_c *BatchImageJobCreateBulk) OnConflictColumns(columns ...string) *BatchImageJobUpsertBulk {
	_c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
	return &BatchImageJobUpsertBulk{
		create: _c,
	}
}

// BatchImageJobUpsertBulk is the builder for "upsert"-ing
// a bulk of BatchImageJob nodes.
type BatchImageJobUpsertBulk struct {
	create *BatchImageJobCreateBulk
}

// UpdateNewValues updates the mutable fields using the new values that
// were set on create. Using this option is equivalent to using:
//
//	client.BatchImageJob.Create().
//		OnConflict(
//			sql.ResolveWithNewValues(),
//		).
//		Exec(ctx)
func (u *BatchImageJobUpsertBulk) UpdateNewValues() *BatchImageJobUpsertBulk {
	u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
		for _, b := range u.create.builders {
			if _, exists := b.mutation.BatchID(); exists {
				s.SetIgnore(batchimagejob.FieldBatchID)
			}
			if _, exists := b.mutation.CreatedAt(); exists {
				s.SetIgnore(batchimagejob.FieldCreatedAt)
			}
		}
	}))
	return u
}

// Ignore sets each column to itself in case of conflict.
// Using this option is equivalent to using:
//
//	client.BatchImageJob.Create().
//		OnConflict(sql.ResolveWithIgnore()).
//		Exec(ctx)
func (u *BatchImageJobUpsertBulk) Ignore() *BatchImageJobUpsertBulk {
	u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
	return u
}

// DoNothing configures the conflict_action to `DO NOTHING`.
// Supported only by SQLite and PostgreSQL.
func (u *BatchImageJobUpsertBulk) DoNothing() *BatchImageJobUpsertBulk {
	u.create.conflict = append(u.create.conflict, sql.DoNothing())
	return u
}

// Update allows overriding fields `UPDATE` values. See the BatchImageJobCreateBulk.OnConflict
// documentation for more info.
func (u *BatchImageJobUpsertBulk) Update(set func(*BatchImageJobUpsert)) *BatchImageJobUpsertBulk {
	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
		set(&BatchImageJobUpsert{UpdateSet: update})
	}))
	return u
}

// SetUserID sets the "user_id" field.
func (u *BatchImageJobUpsertBulk) SetUserID(v int64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetUserID(v)
	})
}

// AddUserID adds v to the "user_id" field.
func (u *BatchImageJobUpsertBulk) AddUserID(v int64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddUserID(v)
	})
}

// UpdateUserID sets the "user_id" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateUserID() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateUserID()
	})
}

// SetAPIKeyID sets the "api_key_id" field.
func (u *BatchImageJobUpsertBulk) SetAPIKeyID(v int64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetAPIKeyID(v)
	})
}

// AddAPIKeyID adds v to the "api_key_id" field.
func (u *BatchImageJobUpsertBulk) AddAPIKeyID(v int64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddAPIKeyID(v)
	})
}

// UpdateAPIKeyID sets the "api_key_id" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateAPIKeyID() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateAPIKeyID()
	})
}

// ClearAPIKeyID clears the value of the "api_key_id" field.
func (u *BatchImageJobUpsertBulk) ClearAPIKeyID() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearAPIKeyID()
	})
}

// SetAccountID sets the "account_id" field.
func (u *BatchImageJobUpsertBulk) SetAccountID(v int64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetAccountID(v)
	})
}

// AddAccountID adds v to the "account_id" field.
func (u *BatchImageJobUpsertBulk) AddAccountID(v int64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddAccountID(v)
	})
}

// UpdateAccountID sets the "account_id" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateAccountID() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateAccountID()
	})
}

// ClearAccountID clears the value of the "account_id" field.
func (u *BatchImageJobUpsertBulk) ClearAccountID() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearAccountID()
	})
}

// SetProvider sets the "provider" field.
func (u *BatchImageJobUpsertBulk) SetProvider(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetProvider(v)
	})
}

// UpdateProvider sets the "provider" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateProvider() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateProvider()
	})
}

// SetModel sets the "model" field.
func (u *BatchImageJobUpsertBulk) SetModel(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetModel(v)
	})
}

// UpdateModel sets the "model" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateModel() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateModel()
	})
}

// SetTaskName sets the "task_name" field.
func (u *BatchImageJobUpsertBulk) SetTaskName(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetTaskName(v)
	})
}

// UpdateTaskName sets the "task_name" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateTaskName() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateTaskName()
	})
}

// SetStatus sets the "status" field.
func (u *BatchImageJobUpsertBulk) SetStatus(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetStatus(v)
	})
}

// UpdateStatus sets the "status" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateStatus() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateStatus()
	})
}

// SetProviderJobName sets the "provider_job_name" field.
func (u *BatchImageJobUpsertBulk) SetProviderJobName(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetProviderJobName(v)
	})
}

// UpdateProviderJobName sets the "provider_job_name" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateProviderJobName() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateProviderJobName()
	})
}

// ClearProviderJobName clears the value of the "provider_job_name" field.
func (u *BatchImageJobUpsertBulk) ClearProviderJobName() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearProviderJobName()
	})
}

// SetProviderInputRef sets the "provider_input_ref" field.
func (u *BatchImageJobUpsertBulk) SetProviderInputRef(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetProviderInputRef(v)
	})
}

// UpdateProviderInputRef sets the "provider_input_ref" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateProviderInputRef() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateProviderInputRef()
	})
}

// ClearProviderInputRef clears the value of the "provider_input_ref" field.
func (u *BatchImageJobUpsertBulk) ClearProviderInputRef() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearProviderInputRef()
	})
}

// SetProviderOutputRef sets the "provider_output_ref" field.
func (u *BatchImageJobUpsertBulk) SetProviderOutputRef(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetProviderOutputRef(v)
	})
}

// UpdateProviderOutputRef sets the "provider_output_ref" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateProviderOutputRef() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateProviderOutputRef()
	})
}

// ClearProviderOutputRef clears the value of the "provider_output_ref" field.
func (u *BatchImageJobUpsertBulk) ClearProviderOutputRef() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearProviderOutputRef()
	})
}

// SetGcsInputURI sets the "gcs_input_uri" field.
func (u *BatchImageJobUpsertBulk) SetGcsInputURI(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetGcsInputURI(v)
	})
}

// UpdateGcsInputURI sets the "gcs_input_uri" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateGcsInputURI() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateGcsInputURI()
	})
}

// ClearGcsInputURI clears the value of the "gcs_input_uri" field.
func (u *BatchImageJobUpsertBulk) ClearGcsInputURI() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearGcsInputURI()
	})
}

// SetGcsOutputURI sets the "gcs_output_uri" field.
func (u *BatchImageJobUpsertBulk) SetGcsOutputURI(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetGcsOutputURI(v)
	})
}

// UpdateGcsOutputURI sets the "gcs_output_uri" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateGcsOutputURI() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateGcsOutputURI()
	})
}

// ClearGcsOutputURI clears the value of the "gcs_output_uri" field.
func (u *BatchImageJobUpsertBulk) ClearGcsOutputURI() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearGcsOutputURI()
	})
}

// SetItemCount sets the "item_count" field.
func (u *BatchImageJobUpsertBulk) SetItemCount(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetItemCount(v)
	})
}

// AddItemCount adds v to the "item_count" field.
func (u *BatchImageJobUpsertBulk) AddItemCount(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddItemCount(v)
	})
}

// UpdateItemCount sets the "item_count" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateItemCount() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateItemCount()
	})
}

// SetSuccessCount sets the "success_count" field.
func (u *BatchImageJobUpsertBulk) SetSuccessCount(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetSuccessCount(v)
	})
}

// AddSuccessCount adds v to the "success_count" field.
func (u *BatchImageJobUpsertBulk) AddSuccessCount(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddSuccessCount(v)
	})
}

// UpdateSuccessCount sets the "success_count" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateSuccessCount() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateSuccessCount()
	})
}

// SetFailCount sets the "fail_count" field.
func (u *BatchImageJobUpsertBulk) SetFailCount(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetFailCount(v)
	})
}

// AddFailCount adds v to the "fail_count" field.
func (u *BatchImageJobUpsertBulk) AddFailCount(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddFailCount(v)
	})
}

// UpdateFailCount sets the "fail_count" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateFailCount() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateFailCount()
	})
}

// SetCancelledCount sets the "cancelled_count" field.
func (u *BatchImageJobUpsertBulk) SetCancelledCount(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetCancelledCount(v)
	})
}

// AddCancelledCount adds v to the "cancelled_count" field.
func (u *BatchImageJobUpsertBulk) AddCancelledCount(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddCancelledCount(v)
	})
}

// UpdateCancelledCount sets the "cancelled_count" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateCancelledCount() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateCancelledCount()
	})
}

// SetEstimatedCost sets the "estimated_cost" field.
func (u *BatchImageJobUpsertBulk) SetEstimatedCost(v float64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetEstimatedCost(v)
	})
}

// AddEstimatedCost adds v to the "estimated_cost" field.
func (u *BatchImageJobUpsertBulk) AddEstimatedCost(v float64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddEstimatedCost(v)
	})
}

// UpdateEstimatedCost sets the "estimated_cost" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateEstimatedCost() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateEstimatedCost()
	})
}

// SetHoldAmount sets the "hold_amount" field.
func (u *BatchImageJobUpsertBulk) SetHoldAmount(v float64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetHoldAmount(v)
	})
}

// AddHoldAmount adds v to the "hold_amount" field.
func (u *BatchImageJobUpsertBulk) AddHoldAmount(v float64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddHoldAmount(v)
	})
}

// UpdateHoldAmount sets the "hold_amount" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateHoldAmount() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateHoldAmount()
	})
}

// ClearHoldAmount clears the value of the "hold_amount" field.
func (u *BatchImageJobUpsertBulk) ClearHoldAmount() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearHoldAmount()
	})
}

// SetActualCost sets the "actual_cost" field.
func (u *BatchImageJobUpsertBulk) SetActualCost(v float64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetActualCost(v)
	})
}

// AddActualCost adds v to the "actual_cost" field.
func (u *BatchImageJobUpsertBulk) AddActualCost(v float64) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddActualCost(v)
	})
}

// UpdateActualCost sets the "actual_cost" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateActualCost() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateActualCost()
	})
}

// ClearActualCost clears the value of the "actual_cost" field.
func (u *BatchImageJobUpsertBulk) ClearActualCost() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearActualCost()
	})
}

// SetCurrency sets the "currency" field.
func (u *BatchImageJobUpsertBulk) SetCurrency(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetCurrency(v)
	})
}

// UpdateCurrency sets the "currency" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateCurrency() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateCurrency()
	})
}

// SetHoldID sets the "hold_id" field.
func (u *BatchImageJobUpsertBulk) SetHoldID(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetHoldID(v)
	})
}

// UpdateHoldID sets the "hold_id" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateHoldID() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateHoldID()
	})
}

// ClearHoldID clears the value of the "hold_id" field.
func (u *BatchImageJobUpsertBulk) ClearHoldID() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearHoldID()
	})
}

// SetIdempotencyKey sets the "idempotency_key" field.
func (u *BatchImageJobUpsertBulk) SetIdempotencyKey(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetIdempotencyKey(v)
	})
}

// UpdateIdempotencyKey sets the "idempotency_key" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateIdempotencyKey() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateIdempotencyKey()
	})
}

// ClearIdempotencyKey clears the value of the "idempotency_key" field.
func (u *BatchImageJobUpsertBulk) ClearIdempotencyKey() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearIdempotencyKey()
	})
}

// SetRequestHash sets the "request_hash" field.
func (u *BatchImageJobUpsertBulk) SetRequestHash(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetRequestHash(v)
	})
}

// UpdateRequestHash sets the "request_hash" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateRequestHash() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateRequestHash()
	})
}

// ClearRequestHash clears the value of the "request_hash" field.
func (u *BatchImageJobUpsertBulk) ClearRequestHash() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearRequestHash()
	})
}

// SetManifestHash sets the "manifest_hash" field.
func (u *BatchImageJobUpsertBulk) SetManifestHash(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetManifestHash(v)
	})
}

// UpdateManifestHash sets the "manifest_hash" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateManifestHash() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateManifestHash()
	})
}

// ClearManifestHash clears the value of the "manifest_hash" field.
func (u *BatchImageJobUpsertBulk) ClearManifestHash() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearManifestHash()
	})
}

// SetRetryCount sets the "retry_count" field.
func (u *BatchImageJobUpsertBulk) SetRetryCount(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetRetryCount(v)
	})
}

// AddRetryCount adds v to the "retry_count" field.
func (u *BatchImageJobUpsertBulk) AddRetryCount(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddRetryCount(v)
	})
}

// UpdateRetryCount sets the "retry_count" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateRetryCount() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateRetryCount()
	})
}

// SetVersion sets the "version" field.
func (u *BatchImageJobUpsertBulk) SetVersion(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetVersion(v)
	})
}

// AddVersion adds v to the "version" field.
func (u *BatchImageJobUpsertBulk) AddVersion(v int) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.AddVersion(v)
	})
}

// UpdateVersion sets the "version" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateVersion() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateVersion()
	})
}

// SetOutputExpiresAt sets the "output_expires_at" field.
func (u *BatchImageJobUpsertBulk) SetOutputExpiresAt(v time.Time) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetOutputExpiresAt(v)
	})
}

// UpdateOutputExpiresAt sets the "output_expires_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateOutputExpiresAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateOutputExpiresAt()
	})
}

// ClearOutputExpiresAt clears the value of the "output_expires_at" field.
func (u *BatchImageJobUpsertBulk) ClearOutputExpiresAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearOutputExpiresAt()
	})
}

// SetInputDeletedAt sets the "input_deleted_at" field.
func (u *BatchImageJobUpsertBulk) SetInputDeletedAt(v time.Time) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetInputDeletedAt(v)
	})
}

// UpdateInputDeletedAt sets the "input_deleted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateInputDeletedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateInputDeletedAt()
	})
}

// ClearInputDeletedAt clears the value of the "input_deleted_at" field.
func (u *BatchImageJobUpsertBulk) ClearInputDeletedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearInputDeletedAt()
	})
}

// SetOutputDeletedAt sets the "output_deleted_at" field.
func (u *BatchImageJobUpsertBulk) SetOutputDeletedAt(v time.Time) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetOutputDeletedAt(v)
	})
}

// UpdateOutputDeletedAt sets the "output_deleted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateOutputDeletedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateOutputDeletedAt()
	})
}

// ClearOutputDeletedAt clears the value of the "output_deleted_at" field.
func (u *BatchImageJobUpsertBulk) ClearOutputDeletedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearOutputDeletedAt()
	})
}

// SetDownloadedAt sets the "downloaded_at" field.
func (u *BatchImageJobUpsertBulk) SetDownloadedAt(v time.Time) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetDownloadedAt(v)
	})
}

// UpdateDownloadedAt sets the "downloaded_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateDownloadedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateDownloadedAt()
	})
}

// ClearDownloadedAt clears the value of the "downloaded_at" field.
func (u *BatchImageJobUpsertBulk) ClearDownloadedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearDownloadedAt()
	})
}

// SetUserDeletedAt sets the "user_deleted_at" field.
func (u *BatchImageJobUpsertBulk) SetUserDeletedAt(v time.Time) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetUserDeletedAt(v)
	})
}

// UpdateUserDeletedAt sets the "user_deleted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateUserDeletedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateUserDeletedAt()
	})
}

// ClearUserDeletedAt clears the value of the "user_deleted_at" field.
func (u *BatchImageJobUpsertBulk) ClearUserDeletedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearUserDeletedAt()
	})
}

// SetLastErrorCode sets the "last_error_code" field.
func (u *BatchImageJobUpsertBulk) SetLastErrorCode(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetLastErrorCode(v)
	})
}

// UpdateLastErrorCode sets the "last_error_code" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateLastErrorCode() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateLastErrorCode()
	})
}

// ClearLastErrorCode clears the value of the "last_error_code" field.
func (u *BatchImageJobUpsertBulk) ClearLastErrorCode() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearLastErrorCode()
	})
}

// SetLastErrorMessage sets the "last_error_message" field.
func (u *BatchImageJobUpsertBulk) SetLastErrorMessage(v string) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetLastErrorMessage(v)
	})
}

// UpdateLastErrorMessage sets the "last_error_message" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateLastErrorMessage() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateLastErrorMessage()
	})
}

// ClearLastErrorMessage clears the value of the "last_error_message" field.
func (u *BatchImageJobUpsertBulk) ClearLastErrorMessage() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearLastErrorMessage()
	})
}

// SetUpdatedAt sets the "updated_at" field.
func (u *BatchImageJobUpsertBulk) SetUpdatedAt(v time.Time) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetUpdatedAt(v)
	})
}

// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateUpdatedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateUpdatedAt()
	})
}

// SetSubmittedAt sets the "submitted_at" field.
func (u *BatchImageJobUpsertBulk) SetSubmittedAt(v time.Time) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetSubmittedAt(v)
	})
}

// UpdateSubmittedAt sets the "submitted_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateSubmittedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateSubmittedAt()
	})
}

// ClearSubmittedAt clears the value of the "submitted_at" field.
func (u *BatchImageJobUpsertBulk) ClearSubmittedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearSubmittedAt()
	})
}

// SetStartedAt sets the "started_at" field.
func (u *BatchImageJobUpsertBulk) SetStartedAt(v time.Time) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetStartedAt(v)
	})
}

// UpdateStartedAt sets the "started_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateStartedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateStartedAt()
	})
}

// ClearStartedAt clears the value of the "started_at" field.
func (u *BatchImageJobUpsertBulk) ClearStartedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearStartedAt()
	})
}

// SetFinishedAt sets the "finished_at" field.
func (u *BatchImageJobUpsertBulk) SetFinishedAt(v time.Time) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetFinishedAt(v)
	})
}

// UpdateFinishedAt sets the "finished_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateFinishedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateFinishedAt()
	})
}

// ClearFinishedAt clears the value of the "finished_at" field.
func (u *BatchImageJobUpsertBulk) ClearFinishedAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearFinishedAt()
	})
}

// SetSettledAt sets the "settled_at" field.
func (u *BatchImageJobUpsertBulk) SetSettledAt(v time.Time) *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.SetSettledAt(v)
	})
}

// UpdateSettledAt sets the "settled_at" field to the value that was provided on create.
func (u *BatchImageJobUpsertBulk) UpdateSettledAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.UpdateSettledAt()
	})
}

// ClearSettledAt clears the value of the "settled_at" field.
func (u *BatchImageJobUpsertBulk) ClearSettledAt() *BatchImageJobUpsertBulk {
	return u.Update(func(s *BatchImageJobUpsert) {
		s.ClearSettledAt()
	})
}

// Exec executes the query.
func (u *BatchImageJobUpsertBulk) Exec(ctx context.Context) error {
	if u.create.err != nil {
		return u.create.err
	}
	for i, b := range u.create.builders {
		if len(b.conflict) != 0 {
			return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the BatchImageJobCreateBulk instead", i)
		}
	}
	if len(u.create.conflict) == 0 {
		return errors.New("ent: missing options for BatchImageJobCreateBulk.OnConflict")
	}
	return u.create.Exec(ctx)
}

// ExecX is like Exec, but panics if an error occurs.
func (u *BatchImageJobUpsertBulk) ExecX(ctx context.Context) {
	if err := u.create.Exec(ctx); err != nil {
		panic(err)
	}
}
