diff --git a/generated/ent/client.go b/generated/ent/client.go index 695b87e6..4bc23aca 100644 --- a/generated/ent/client.go +++ b/generated/ent/client.go @@ -43,9 +43,7 @@ type Client struct { // NewClient creates a new client configured with the given options. func NewClient(opts ...Option) *Client { - cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}} - cfg.options(opts...) - client := &Client{config: cfg} + client := &Client{config: newConfig(opts...)} client.init() return client } @@ -76,6 +74,13 @@ type ( Option func(*config) ) +// newConfig creates a new config for the client. +func newConfig(opts ...Option) config { + cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}} + cfg.options(opts...) + return cfg +} + // options applies the options on the config object. func (c *config) options(opts ...Option) { for _, opt := range opts { diff --git a/generated/ent/history_update.go b/generated/ent/history_update.go index 14b883f5..a8da1c40 100644 --- a/generated/ent/history_update.go +++ b/generated/ent/history_update.go @@ -39,6 +39,14 @@ func (hu *HistoryUpdate) SetMtime(t time.Time) *HistoryUpdate { return hu } +// SetNillableMtime sets the "mtime" field if the given value is not nil. +func (hu *HistoryUpdate) SetNillableMtime(t *time.Time) *HistoryUpdate { + if t != nil { + hu.SetMtime(*t) + } + return hu +} + // SetStatus sets the "status" field. func (hu *HistoryUpdate) SetStatus(ms model.JobStatus) *HistoryUpdate { hu.mutation.SetStatus(ms) @@ -207,6 +215,14 @@ func (huo *HistoryUpdateOne) SetMtime(t time.Time) *HistoryUpdateOne { return huo } +// SetNillableMtime sets the "mtime" field if the given value is not nil. +func (huo *HistoryUpdateOne) SetNillableMtime(t *time.Time) *HistoryUpdateOne { + if t != nil { + huo.SetMtime(*t) + } + return huo +} + // SetStatus sets the "status" field. func (huo *HistoryUpdateOne) SetStatus(ms model.JobStatus) *HistoryUpdateOne { huo.mutation.SetStatus(ms) diff --git a/generated/ent/job_update.go b/generated/ent/job_update.go index 6ea43086..c759a604 100644 --- a/generated/ent/job_update.go +++ b/generated/ent/job_update.go @@ -61,6 +61,14 @@ func (ju *JobUpdate) SetClientID(s string) *JobUpdate { return ju } +// SetNillableClientID sets the "client_id" field if the given value is not nil. +func (ju *JobUpdate) SetNillableClientID(s *string) *JobUpdate { + if s != nil { + ju.SetClientID(*s) + } + return ju +} + // SetDefinition sets the "definition" field. func (ju *JobUpdate) SetDefinition(m map[string]interface{}) *JobUpdate { ju.mutation.SetDefinition(m) @@ -79,6 +87,14 @@ func (ju *JobUpdate) SetStatus(ms model.JobStatus) *JobUpdate { return ju } +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ju *JobUpdate) SetNillableStatus(ms *model.JobStatus) *JobUpdate { + if ms != nil { + ju.SetStatus(*ms) + } + return ju +} + // SetGroup sets the "group" field. func (ju *JobUpdate) SetGroup(s string) *JobUpdate { ju.mutation.SetGroup(s) @@ -435,6 +451,14 @@ func (juo *JobUpdateOne) SetClientID(s string) *JobUpdateOne { return juo } +// SetNillableClientID sets the "client_id" field if the given value is not nil. +func (juo *JobUpdateOne) SetNillableClientID(s *string) *JobUpdateOne { + if s != nil { + juo.SetClientID(*s) + } + return juo +} + // SetDefinition sets the "definition" field. func (juo *JobUpdateOne) SetDefinition(m map[string]interface{}) *JobUpdateOne { juo.mutation.SetDefinition(m) @@ -453,6 +477,14 @@ func (juo *JobUpdateOne) SetStatus(ms model.JobStatus) *JobUpdateOne { return juo } +// SetNillableStatus sets the "status" field if the given value is not nil. +func (juo *JobUpdateOne) SetNillableStatus(ms *model.JobStatus) *JobUpdateOne { + if ms != nil { + juo.SetStatus(*ms) + } + return juo +} + // SetGroup sets the "group" field. func (juo *JobUpdateOne) SetGroup(s string) *JobUpdateOne { juo.mutation.SetGroup(s) diff --git a/generated/ent/runtime/runtime.go b/generated/ent/runtime/runtime.go index 6a3aa78a..67fd8cfd 100644 --- a/generated/ent/runtime/runtime.go +++ b/generated/ent/runtime/runtime.go @@ -8,6 +8,6 @@ package runtime // The schema-stitching logic is generated in github.com/siemens/wfx/generated/ent/runtime.go const ( - Version = "v0.12.4" // Version of ent codegen. - Sum = "h1:LddPnAyxls/O7DTXZvUGDj0NZIdGSu317+aoNLJWbD8=" // Sum of ent codegen. + Version = "v0.12.5" // Version of ent codegen. + Sum = "h1:KREM5E4CSoej4zeGa88Ou/gfturAnpUv0mzAjch1sj4=" // Sum of ent codegen. ) diff --git a/generated/ent/tag_update.go b/generated/ent/tag_update.go index 42ba3302..84f2ee84 100644 --- a/generated/ent/tag_update.go +++ b/generated/ent/tag_update.go @@ -37,6 +37,14 @@ func (tu *TagUpdate) SetName(s string) *TagUpdate { return tu } +// SetNillableName sets the "name" field if the given value is not nil. +func (tu *TagUpdate) SetNillableName(s *string) *TagUpdate { + if s != nil { + tu.SetName(*s) + } + return tu +} + // AddJobIDs adds the "jobs" edge to the Job entity by IDs. func (tu *TagUpdate) AddJobIDs(ids ...string) *TagUpdate { tu.mutation.AddJobIDs(ids...) @@ -188,6 +196,14 @@ func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne { return tuo } +// SetNillableName sets the "name" field if the given value is not nil. +func (tuo *TagUpdateOne) SetNillableName(s *string) *TagUpdateOne { + if s != nil { + tuo.SetName(*s) + } + return tuo +} + // AddJobIDs adds the "jobs" edge to the Job entity by IDs. func (tuo *TagUpdateOne) AddJobIDs(ids ...string) *TagUpdateOne { tuo.mutation.AddJobIDs(ids...) diff --git a/generated/ent/workflow_update.go b/generated/ent/workflow_update.go index eba06197..eb934edb 100644 --- a/generated/ent/workflow_update.go +++ b/generated/ent/workflow_update.go @@ -39,6 +39,14 @@ func (wu *WorkflowUpdate) SetName(s string) *WorkflowUpdate { return wu } +// SetNillableName sets the "name" field if the given value is not nil. +func (wu *WorkflowUpdate) SetNillableName(s *string) *WorkflowUpdate { + if s != nil { + wu.SetName(*s) + } + return wu +} + // SetDescription sets the "description" field. func (wu *WorkflowUpdate) SetDescription(s string) *WorkflowUpdate { wu.mutation.SetDescription(s) @@ -294,6 +302,14 @@ func (wuo *WorkflowUpdateOne) SetName(s string) *WorkflowUpdateOne { return wuo } +// SetNillableName sets the "name" field if the given value is not nil. +func (wuo *WorkflowUpdateOne) SetNillableName(s *string) *WorkflowUpdateOne { + if s != nil { + wuo.SetName(*s) + } + return wuo +} + // SetDescription sets the "description" field. func (wuo *WorkflowUpdateOne) SetDescription(s string) *WorkflowUpdateOne { wuo.mutation.SetDescription(s) diff --git a/go.mod b/go.mod index 400a7b85..d418309a 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/siemens/wfx go 1.19 require ( - entgo.io/ent v0.12.4 + entgo.io/ent v0.12.5 github.com/OpenPeeDeeP/xdg v1.0.0 github.com/Southclaws/fault v0.8.0 github.com/alexliesenfeld/health v0.8.0 diff --git a/go.sum b/go.sum index 2ce323fd..132b31a3 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ ariga.io/atlas v0.14.1-0.20230918065911-83ad451a4935 h1:JnYs/y8RJ3+MiIUp+3RgyyeO48VHLAZimqiaZYnMKk8= ariga.io/atlas v0.14.1-0.20230918065911-83ad451a4935/go.mod h1:isZrlzJ5cpoCoKFoY9knZug7Lq4pP1cm8g3XciLZ0Pw= -entgo.io/ent v0.12.4 h1:LddPnAyxls/O7DTXZvUGDj0NZIdGSu317+aoNLJWbD8= -entgo.io/ent v0.12.4/go.mod h1:Y3JVAjtlIk8xVZYSn3t3mf8xlZIn5SAOXZQxD6kKI+Q= +entgo.io/ent v0.12.5 h1:KREM5E4CSoej4zeGa88Ou/gfturAnpUv0mzAjch1sj4= +entgo.io/ent v0.12.5/go.mod h1:Y3JVAjtlIk8xVZYSn3t3mf8xlZIn5SAOXZQxD6kKI+Q= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=