From 84787913ff3d0c199abb561dc363408667cbbe17 Mon Sep 17 00:00:00 2001 From: Tyler Auerbeck <29497147+tylerauerbeck@users.noreply.github.com> Date: Wed, 7 Feb 2024 16:14:20 -0500 Subject: [PATCH] Add audit-fields to schemas (#319) * Add audit fields Signed-off-by: Tyler Auerbeck * Add audit to the rest of schemas; Update resolvers Signed-off-by: Tyler Auerbeck * Cleanup fields Signed-off-by: Tyler Auerbeck * Fix lints Signed-off-by: Tyler Auerbeck * Fix lints, pt 2 Signed-off-by: Tyler Auerbeck * Fix failing tests Signed-off-by: Tyler Auerbeck * Cleanup migrations Signed-off-by: Tyler Auerbeck --------- Signed-off-by: Tyler Auerbeck Co-authored-by: Tyler Auerbeck --- db/migrations/20240207205734_audit-fields.sql | 23 + db/migrations/atlas.sum | 5 +- go.sum | 8 + internal/ent/generated/client.go | 15 +- internal/ent/generated/gql_collection.go | 50 + internal/ent/generated/gql_pagination.go | 180 ++ internal/ent/generated/gql_where_input.go | 620 ++++ internal/ent/generated/loadbalancer.go | 24 +- .../generated/loadbalancer/loadbalancer.go | 23 + internal/ent/generated/loadbalancer/where.go | 160 + internal/ent/generated/loadbalancer_create.go | 52 +- internal/ent/generated/loadbalancer_update.go | 78 +- internal/ent/generated/migrate/schema.go | 32 +- internal/ent/generated/mutation.go | 765 ++++- internal/ent/generated/origin.go | 24 +- internal/ent/generated/origin/origin.go | 23 + internal/ent/generated/origin/where.go | 160 + internal/ent/generated/origin_create.go | 52 +- internal/ent/generated/origin_update.go | 78 +- internal/ent/generated/pool.go | 24 +- internal/ent/generated/pool/pool.go | 23 + internal/ent/generated/pool/where.go | 160 + internal/ent/generated/pool_create.go | 52 +- internal/ent/generated/pool_update.go | 78 +- internal/ent/generated/port.go | 24 +- internal/ent/generated/port/port.go | 23 + internal/ent/generated/port/where.go | 160 + internal/ent/generated/port_create.go | 52 +- internal/ent/generated/port_update.go | 78 +- internal/ent/generated/provider.go | 24 +- internal/ent/generated/provider/provider.go | 23 + internal/ent/generated/provider/where.go | 160 + internal/ent/generated/provider_create.go | 52 +- internal/ent/generated/provider_update.go | 78 +- internal/ent/generated/runtime.go | 220 +- internal/ent/generated/runtime/runtime.go | 230 +- internal/ent/schema/audit/doc.go | 2 + internal/ent/schema/audit/errors.go | 10 + internal/ent/schema/audit/mixin.go | 77 + internal/ent/schema/loadbalancer.go | 2 + internal/ent/schema/origin.go | 2 + internal/ent/schema/pool.go | 2 + internal/ent/schema/port.go | 2 + internal/ent/schema/provider.go | 2 + internal/graphapi/gen_server.go | 2562 +++++++++++++++-- internal/graphapi/loadbalancer.resolvers.go | 8 +- internal/graphapi/loadbalancer_test.go | 5 + internal/graphapi/location.resolvers.go | 1 + internal/graphapi/metadata.go | 2 + internal/graphapi/origin.resolvers.go | 6 +- internal/graphapi/origin_test.go | 4 + internal/graphapi/owner.resolvers.go | 1 + internal/graphapi/owner_resolvers_test.go | 1 + internal/graphapi/pool.resolvers.go | 8 +- internal/graphapi/pool_test.go | 4 + internal/graphapi/port.resolvers.go | 6 +- internal/graphapi/port_test.go | 3 + internal/graphapi/provider.resolvers.go | 1 + internal/graphapi/provider_test.go | 2 + internal/graphclient/gen_models.go | 200 +- internal/graphclient/schema/schema.graphql | 180 ++ internal/manualhooks/hooks.go | 2 + pkg/client/client_test.go | 1 + schema.graphql | 180 ++ schema/ent.graphql | 180 ++ 65 files changed, 6782 insertions(+), 507 deletions(-) create mode 100644 db/migrations/20240207205734_audit-fields.sql create mode 100644 internal/ent/schema/audit/doc.go create mode 100644 internal/ent/schema/audit/errors.go create mode 100644 internal/ent/schema/audit/mixin.go diff --git a/db/migrations/20240207205734_audit-fields.sql b/db/migrations/20240207205734_audit-fields.sql new file mode 100644 index 000000000..b554530aa --- /dev/null +++ b/db/migrations/20240207205734_audit-fields.sql @@ -0,0 +1,23 @@ +-- +goose Up +-- modify "load_balancers" table +ALTER TABLE "load_balancers" ADD COLUMN "created_by" character varying NULL, ADD COLUMN "updated_by" character varying NULL; +-- modify "origins" table +ALTER TABLE "origins" ADD COLUMN "created_by" character varying NULL, ADD COLUMN "updated_by" character varying NULL; +-- modify "pools" table +ALTER TABLE "pools" ADD COLUMN "created_by" character varying NULL, ADD COLUMN "updated_by" character varying NULL; +-- modify "ports" table +ALTER TABLE "ports" ADD COLUMN "created_by" character varying NULL, ADD COLUMN "updated_by" character varying NULL; +-- modify "providers" table +ALTER TABLE "providers" ADD COLUMN "created_by" character varying NULL, ADD COLUMN "updated_by" character varying NULL; + +-- +goose Down +-- reverse: modify "providers" table +ALTER TABLE "providers" DROP COLUMN "updated_by", DROP COLUMN "created_by"; +-- reverse: modify "ports" table +ALTER TABLE "ports" DROP COLUMN "updated_by", DROP COLUMN "created_by"; +-- reverse: modify "pools" table +ALTER TABLE "pools" DROP COLUMN "updated_by", DROP COLUMN "created_by"; +-- reverse: modify "origins" table +ALTER TABLE "origins" DROP COLUMN "updated_by", DROP COLUMN "created_by"; +-- reverse: modify "load_balancers" table +ALTER TABLE "load_balancers" DROP COLUMN "updated_by", DROP COLUMN "created_by"; diff --git a/db/migrations/atlas.sum b/db/migrations/atlas.sum index ff1077165..6dc49d5bb 100644 --- a/db/migrations/atlas.sum +++ b/db/migrations/atlas.sum @@ -1,5 +1,6 @@ -h1:C2ooKhLvT6ZWxsvbhzwIlh+LWFh+wU+nRN1onsCHlkw= +h1:VbjEjTYQpHluH7ZPRqCN9Xz2sRkWFqFjgcQjf19L/xo= 20230503185445_initial-migration.sql h1:4pqNp2MDBBRdGxU/H5mmZui9oi1SyjIiMVGatajrBeY= 20230615194819_drop_tenant_add_owner.sql h1:KGCsItU0NYhxYEkhZOaMQjfIrBMnek5rxC6D/LhnyCk= 20230629085916_drop_status_and_annotations.sql h1:kvDMoaMEjyoj/aRi6rw4XvCLxGH09vGGLbL0/p5tpPo= -20231017005257_add_origin_weight.sql h1:G0SKQBweZg4S9IvpnoIeVJ05aLSiNb3PWnJcZyo+2fg= +20231017005257_add_origin_weight.sql h1:NuorUbcydDqcyPK8wgwlkQxaH+zGWfVtJW9UPL1Vn+E= +20240207205734_audit-fields.sql h1:cplFCBB7laCP5Y+UAoxIfITMo56Hoc5XIVvgcfGL9o0= diff --git a/go.sum b/go.sum index 18fd7efc8..e14c36188 100644 --- a/go.sum +++ b/go.sum @@ -116,6 +116,7 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= @@ -471,6 +472,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= @@ -539,6 +542,9 @@ github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFA github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= +github.com/urfave/cli v1.22.12 h1:igJgVw1JdKH+trcLWLeLwZjU9fEfPesQ+9/e4MQ44S8= +github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= +github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= @@ -559,6 +565,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/ydb-platform/ydb-go-genproto v0.0.0-20231012155159-f85a672542fd h1:dzWP1Lu+A40W883dK/Mr3xyDSM/2MggS8GtHT0qgAnE= github.com/ydb-platform/ydb-go-genproto v0.0.0-20231012155159-f85a672542fd/go.mod h1:Er+FePu1dNUieD+XTMDduGpQuCPssK5Q4BjF+IIXJ3I= github.com/ydb-platform/ydb-go-sdk/v3 v3.54.2 h1:E0yUuuX7UmPxXm92+yQCjMveLFO3zfvYFIJVuAqsVRA= diff --git a/internal/ent/generated/client.go b/internal/ent/generated/client.go index bd6e5d41e..e54c947e7 100644 --- a/internal/ent/generated/client.go +++ b/internal/ent/generated/client.go @@ -398,7 +398,8 @@ func (c *LoadBalancerClient) QueryProvider(lb *LoadBalancer) *ProviderQuery { // Hooks returns the client hooks. func (c *LoadBalancerClient) Hooks() []Hook { - return c.hooks.LoadBalancer + hooks := c.hooks.LoadBalancer + return append(hooks[:len(hooks):len(hooks)], loadbalancer.Hooks[:]...) } // Interceptors returns the client interceptors. @@ -547,7 +548,8 @@ func (c *OriginClient) QueryPool(o *Origin) *PoolQuery { // Hooks returns the client hooks. func (c *OriginClient) Hooks() []Hook { - return c.hooks.Origin + hooks := c.hooks.Origin + return append(hooks[:len(hooks):len(hooks)], origin.Hooks[:]...) } // Interceptors returns the client interceptors. @@ -712,7 +714,8 @@ func (c *PoolClient) QueryOrigins(po *Pool) *OriginQuery { // Hooks returns the client hooks. func (c *PoolClient) Hooks() []Hook { - return c.hooks.Pool + hooks := c.hooks.Pool + return append(hooks[:len(hooks):len(hooks)], pool.Hooks[:]...) } // Interceptors returns the client interceptors. @@ -877,7 +880,8 @@ func (c *PortClient) QueryLoadBalancer(po *Port) *LoadBalancerQuery { // Hooks returns the client hooks. func (c *PortClient) Hooks() []Hook { - return c.hooks.Port + hooks := c.hooks.Port + return append(hooks[:len(hooks):len(hooks)], port.Hooks[:]...) } // Interceptors returns the client interceptors. @@ -1026,7 +1030,8 @@ func (c *ProviderClient) QueryLoadBalancers(pr *Provider) *LoadBalancerQuery { // Hooks returns the client hooks. func (c *ProviderClient) Hooks() []Hook { - return c.hooks.Provider + hooks := c.hooks.Provider + return append(hooks[:len(hooks):len(hooks)], provider.Hooks[:]...) } // Interceptors returns the client interceptors. diff --git a/internal/ent/generated/gql_collection.go b/internal/ent/generated/gql_collection.go index 9547396c8..7ddb9e52d 100644 --- a/internal/ent/generated/gql_collection.go +++ b/internal/ent/generated/gql_collection.go @@ -161,6 +161,16 @@ func (lb *LoadBalancerQuery) collectField(ctx context.Context, opCtx *graphql.Op selectedFields = append(selectedFields, loadbalancer.FieldUpdatedAt) fieldSeen[loadbalancer.FieldUpdatedAt] = struct{}{} } + case "createdBy": + if _, ok := fieldSeen[loadbalancer.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, loadbalancer.FieldCreatedBy) + fieldSeen[loadbalancer.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[loadbalancer.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, loadbalancer.FieldUpdatedBy) + fieldSeen[loadbalancer.FieldUpdatedBy] = struct{}{} + } case "name": if _, ok := fieldSeen[loadbalancer.FieldName]; !ok { selectedFields = append(selectedFields, loadbalancer.FieldName) @@ -274,6 +284,16 @@ func (o *OriginQuery) collectField(ctx context.Context, opCtx *graphql.Operation selectedFields = append(selectedFields, origin.FieldUpdatedAt) fieldSeen[origin.FieldUpdatedAt] = struct{}{} } + case "createdBy": + if _, ok := fieldSeen[origin.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, origin.FieldCreatedBy) + fieldSeen[origin.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[origin.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, origin.FieldUpdatedBy) + fieldSeen[origin.FieldUpdatedBy] = struct{}{} + } case "name": if _, ok := fieldSeen[origin.FieldName]; !ok { selectedFields = append(selectedFields, origin.FieldName) @@ -494,6 +514,16 @@ func (po *PoolQuery) collectField(ctx context.Context, opCtx *graphql.OperationC selectedFields = append(selectedFields, pool.FieldUpdatedAt) fieldSeen[pool.FieldUpdatedAt] = struct{}{} } + case "createdBy": + if _, ok := fieldSeen[pool.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, pool.FieldCreatedBy) + fieldSeen[pool.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[pool.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, pool.FieldUpdatedBy) + fieldSeen[pool.FieldUpdatedBy] = struct{}{} + } case "name": if _, ok := fieldSeen[pool.FieldName]; !ok { selectedFields = append(selectedFields, pool.FieldName) @@ -629,6 +659,16 @@ func (po *PortQuery) collectField(ctx context.Context, opCtx *graphql.OperationC selectedFields = append(selectedFields, port.FieldUpdatedAt) fieldSeen[port.FieldUpdatedAt] = struct{}{} } + case "createdBy": + if _, ok := fieldSeen[port.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, port.FieldCreatedBy) + fieldSeen[port.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[port.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, port.FieldUpdatedBy) + fieldSeen[port.FieldUpdatedBy] = struct{}{} + } case "number": if _, ok := fieldSeen[port.FieldNumber]; !ok { selectedFields = append(selectedFields, port.FieldNumber) @@ -822,6 +862,16 @@ func (pr *ProviderQuery) collectField(ctx context.Context, opCtx *graphql.Operat selectedFields = append(selectedFields, provider.FieldUpdatedAt) fieldSeen[provider.FieldUpdatedAt] = struct{}{} } + case "createdBy": + if _, ok := fieldSeen[provider.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, provider.FieldCreatedBy) + fieldSeen[provider.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[provider.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, provider.FieldUpdatedBy) + fieldSeen[provider.FieldUpdatedBy] = struct{}{} + } case "name": if _, ok := fieldSeen[provider.FieldName]; !ok { selectedFields = append(selectedFields, provider.FieldName) diff --git a/internal/ent/generated/gql_pagination.go b/internal/ent/generated/gql_pagination.go index b692adbb5..a6d6ebf21 100644 --- a/internal/ent/generated/gql_pagination.go +++ b/internal/ent/generated/gql_pagination.go @@ -365,6 +365,34 @@ var ( } }, } + // LoadBalancerOrderFieldCreatedBy orders LoadBalancer by created_by. + LoadBalancerOrderFieldCreatedBy = &LoadBalancerOrderField{ + Value: func(lb *LoadBalancer) (ent.Value, error) { + return lb.CreatedBy, nil + }, + column: loadbalancer.FieldCreatedBy, + toTerm: loadbalancer.ByCreatedBy, + toCursor: func(lb *LoadBalancer) Cursor { + return Cursor{ + ID: lb.ID, + Value: lb.CreatedBy, + } + }, + } + // LoadBalancerOrderFieldUpdatedBy orders LoadBalancer by updated_by. + LoadBalancerOrderFieldUpdatedBy = &LoadBalancerOrderField{ + Value: func(lb *LoadBalancer) (ent.Value, error) { + return lb.UpdatedBy, nil + }, + column: loadbalancer.FieldUpdatedBy, + toTerm: loadbalancer.ByUpdatedBy, + toCursor: func(lb *LoadBalancer) Cursor { + return Cursor{ + ID: lb.ID, + Value: lb.UpdatedBy, + } + }, + } // LoadBalancerOrderFieldName orders LoadBalancer by name. LoadBalancerOrderFieldName = &LoadBalancerOrderField{ Value: func(lb *LoadBalancer) (ent.Value, error) { @@ -405,6 +433,10 @@ func (f LoadBalancerOrderField) String() string { str = "CREATED_AT" case LoadBalancerOrderFieldUpdatedAt.column: str = "UPDATED_AT" + case LoadBalancerOrderFieldCreatedBy.column: + str = "CREATED_BY" + case LoadBalancerOrderFieldUpdatedBy.column: + str = "UPDATED_BY" case LoadBalancerOrderFieldName.column: str = "NAME" case LoadBalancerOrderFieldOwnerID.column: @@ -431,6 +463,10 @@ func (f *LoadBalancerOrderField) UnmarshalGQL(v interface{}) error { *f = *LoadBalancerOrderFieldCreatedAt case "UPDATED_AT": *f = *LoadBalancerOrderFieldUpdatedAt + case "CREATED_BY": + *f = *LoadBalancerOrderFieldCreatedBy + case "UPDATED_BY": + *f = *LoadBalancerOrderFieldUpdatedBy case "NAME": *f = *LoadBalancerOrderFieldName case "OWNER": @@ -719,6 +755,34 @@ var ( } }, } + // OriginOrderFieldCreatedBy orders Origin by created_by. + OriginOrderFieldCreatedBy = &LoadBalancerOriginOrderField{ + Value: func(o *LoadBalancerOrigin) (ent.Value, error) { + return o.CreatedBy, nil + }, + column: origin.FieldCreatedBy, + toTerm: origin.ByCreatedBy, + toCursor: func(o *LoadBalancerOrigin) Cursor { + return Cursor{ + ID: o.ID, + Value: o.CreatedBy, + } + }, + } + // OriginOrderFieldUpdatedBy orders Origin by updated_by. + OriginOrderFieldUpdatedBy = &LoadBalancerOriginOrderField{ + Value: func(o *LoadBalancerOrigin) (ent.Value, error) { + return o.UpdatedBy, nil + }, + column: origin.FieldUpdatedBy, + toTerm: origin.ByUpdatedBy, + toCursor: func(o *LoadBalancerOrigin) Cursor { + return Cursor{ + ID: o.ID, + Value: o.UpdatedBy, + } + }, + } // OriginOrderFieldName orders Origin by name. OriginOrderFieldName = &LoadBalancerOriginOrderField{ Value: func(o *LoadBalancerOrigin) (ent.Value, error) { @@ -799,6 +863,10 @@ func (f LoadBalancerOriginOrderField) String() string { str = "CREATED_AT" case OriginOrderFieldUpdatedAt.column: str = "UPDATED_AT" + case OriginOrderFieldCreatedBy.column: + str = "CREATED_BY" + case OriginOrderFieldUpdatedBy.column: + str = "UPDATED_BY" case OriginOrderFieldName.column: str = "name" case OriginOrderFieldWeight.column: @@ -829,6 +897,10 @@ func (f *LoadBalancerOriginOrderField) UnmarshalGQL(v interface{}) error { *f = *OriginOrderFieldCreatedAt case "UPDATED_AT": *f = *OriginOrderFieldUpdatedAt + case "CREATED_BY": + *f = *OriginOrderFieldCreatedBy + case "UPDATED_BY": + *f = *OriginOrderFieldUpdatedBy case "name": *f = *OriginOrderFieldName case "weight": @@ -1123,6 +1195,34 @@ var ( } }, } + // PoolOrderFieldCreatedBy orders Pool by created_by. + PoolOrderFieldCreatedBy = &LoadBalancerPoolOrderField{ + Value: func(po *LoadBalancerPool) (ent.Value, error) { + return po.CreatedBy, nil + }, + column: pool.FieldCreatedBy, + toTerm: pool.ByCreatedBy, + toCursor: func(po *LoadBalancerPool) Cursor { + return Cursor{ + ID: po.ID, + Value: po.CreatedBy, + } + }, + } + // PoolOrderFieldUpdatedBy orders Pool by updated_by. + PoolOrderFieldUpdatedBy = &LoadBalancerPoolOrderField{ + Value: func(po *LoadBalancerPool) (ent.Value, error) { + return po.UpdatedBy, nil + }, + column: pool.FieldUpdatedBy, + toTerm: pool.ByUpdatedBy, + toCursor: func(po *LoadBalancerPool) Cursor { + return Cursor{ + ID: po.ID, + Value: po.UpdatedBy, + } + }, + } // PoolOrderFieldName orders Pool by name. PoolOrderFieldName = &LoadBalancerPoolOrderField{ Value: func(po *LoadBalancerPool) (ent.Value, error) { @@ -1161,6 +1261,10 @@ func (f LoadBalancerPoolOrderField) String() string { str = "CREATED_AT" case PoolOrderFieldUpdatedAt.column: str = "UPDATED_AT" + case PoolOrderFieldCreatedBy.column: + str = "CREATED_BY" + case PoolOrderFieldUpdatedBy.column: + str = "UPDATED_BY" case PoolOrderFieldName.column: str = "name" case PoolOrderFieldProtocol.column: @@ -1185,6 +1289,10 @@ func (f *LoadBalancerPoolOrderField) UnmarshalGQL(v interface{}) error { *f = *PoolOrderFieldCreatedAt case "UPDATED_AT": *f = *PoolOrderFieldUpdatedAt + case "CREATED_BY": + *f = *PoolOrderFieldCreatedBy + case "UPDATED_BY": + *f = *PoolOrderFieldUpdatedBy case "name": *f = *PoolOrderFieldName case "protocol": @@ -1473,6 +1581,34 @@ var ( } }, } + // PortOrderFieldCreatedBy orders Port by created_by. + PortOrderFieldCreatedBy = &LoadBalancerPortOrderField{ + Value: func(po *LoadBalancerPort) (ent.Value, error) { + return po.CreatedBy, nil + }, + column: port.FieldCreatedBy, + toTerm: port.ByCreatedBy, + toCursor: func(po *LoadBalancerPort) Cursor { + return Cursor{ + ID: po.ID, + Value: po.CreatedBy, + } + }, + } + // PortOrderFieldUpdatedBy orders Port by updated_by. + PortOrderFieldUpdatedBy = &LoadBalancerPortOrderField{ + Value: func(po *LoadBalancerPort) (ent.Value, error) { + return po.UpdatedBy, nil + }, + column: port.FieldUpdatedBy, + toTerm: port.ByUpdatedBy, + toCursor: func(po *LoadBalancerPort) Cursor { + return Cursor{ + ID: po.ID, + Value: po.UpdatedBy, + } + }, + } // PortOrderFieldNumber orders Port by number. PortOrderFieldNumber = &LoadBalancerPortOrderField{ Value: func(po *LoadBalancerPort) (ent.Value, error) { @@ -1511,6 +1647,10 @@ func (f LoadBalancerPortOrderField) String() string { str = "CREATED_AT" case PortOrderFieldUpdatedAt.column: str = "UPDATED_AT" + case PortOrderFieldCreatedBy.column: + str = "CREATED_BY" + case PortOrderFieldUpdatedBy.column: + str = "UPDATED_BY" case PortOrderFieldNumber.column: str = "number" case PortOrderFieldName.column: @@ -1535,6 +1675,10 @@ func (f *LoadBalancerPortOrderField) UnmarshalGQL(v interface{}) error { *f = *PortOrderFieldCreatedAt case "UPDATED_AT": *f = *PortOrderFieldUpdatedAt + case "CREATED_BY": + *f = *PortOrderFieldCreatedBy + case "UPDATED_BY": + *f = *PortOrderFieldUpdatedBy case "number": *f = *PortOrderFieldNumber case "name": @@ -1837,6 +1981,34 @@ var ( } }, } + // ProviderOrderFieldCreatedBy orders Provider by created_by. + ProviderOrderFieldCreatedBy = &LoadBalancerProviderOrderField{ + Value: func(pr *LoadBalancerProvider) (ent.Value, error) { + return pr.CreatedBy, nil + }, + column: provider.FieldCreatedBy, + toTerm: provider.ByCreatedBy, + toCursor: func(pr *LoadBalancerProvider) Cursor { + return Cursor{ + ID: pr.ID, + Value: pr.CreatedBy, + } + }, + } + // ProviderOrderFieldUpdatedBy orders Provider by updated_by. + ProviderOrderFieldUpdatedBy = &LoadBalancerProviderOrderField{ + Value: func(pr *LoadBalancerProvider) (ent.Value, error) { + return pr.UpdatedBy, nil + }, + column: provider.FieldUpdatedBy, + toTerm: provider.ByUpdatedBy, + toCursor: func(pr *LoadBalancerProvider) Cursor { + return Cursor{ + ID: pr.ID, + Value: pr.UpdatedBy, + } + }, + } // ProviderOrderFieldName orders Provider by name. ProviderOrderFieldName = &LoadBalancerProviderOrderField{ Value: func(pr *LoadBalancerProvider) (ent.Value, error) { @@ -1877,6 +2049,10 @@ func (f LoadBalancerProviderOrderField) String() string { str = "CREATED_AT" case ProviderOrderFieldUpdatedAt.column: str = "UPDATED_AT" + case ProviderOrderFieldCreatedBy.column: + str = "CREATED_BY" + case ProviderOrderFieldUpdatedBy.column: + str = "UPDATED_BY" case ProviderOrderFieldName.column: str = "NAME" case ProviderOrderFieldOwnerID.column: @@ -1903,6 +2079,10 @@ func (f *LoadBalancerProviderOrderField) UnmarshalGQL(v interface{}) error { *f = *ProviderOrderFieldCreatedAt case "UPDATED_AT": *f = *ProviderOrderFieldUpdatedAt + case "CREATED_BY": + *f = *ProviderOrderFieldCreatedBy + case "UPDATED_BY": + *f = *ProviderOrderFieldUpdatedBy case "NAME": *f = *ProviderOrderFieldName case "OWNER": diff --git a/internal/ent/generated/gql_where_input.go b/internal/ent/generated/gql_where_input.go index 631c26348..a081e9619 100644 --- a/internal/ent/generated/gql_where_input.go +++ b/internal/ent/generated/gql_where_input.go @@ -67,6 +67,40 @@ type LoadBalancerWhereInput struct { UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // "name" field predicates. Name *string `json:"name,omitempty"` NameNEQ *string `json:"nameNEQ,omitempty"` @@ -234,6 +268,96 @@ func (i *LoadBalancerWhereInput) P() (predicate.LoadBalancer, error) { if i.UpdatedAtLTE != nil { predicates = append(predicates, loadbalancer.UpdatedAtLTE(*i.UpdatedAtLTE)) } + if i.CreatedBy != nil { + predicates = append(predicates, loadbalancer.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, loadbalancer.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, loadbalancer.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, loadbalancer.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, loadbalancer.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, loadbalancer.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, loadbalancer.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, loadbalancer.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, loadbalancer.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, loadbalancer.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, loadbalancer.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, loadbalancer.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, loadbalancer.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, loadbalancer.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, loadbalancer.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, loadbalancer.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, loadbalancer.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, loadbalancer.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, loadbalancer.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, loadbalancer.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, loadbalancer.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, loadbalancer.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, loadbalancer.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, loadbalancer.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, loadbalancer.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, loadbalancer.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, loadbalancer.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, loadbalancer.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, loadbalancer.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, loadbalancer.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } if i.Name != nil { predicates = append(predicates, loadbalancer.NameEQ(*i.Name)) } @@ -357,6 +481,40 @@ type LoadBalancerOriginWhereInput struct { UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // "name" field predicates. Name *string `json:"name,omitempty"` NameNEQ *string `json:"nameNEQ,omitempty"` @@ -559,6 +717,96 @@ func (i *LoadBalancerOriginWhereInput) P() (predicate.Origin, error) { if i.UpdatedAtLTE != nil { predicates = append(predicates, origin.UpdatedAtLTE(*i.UpdatedAtLTE)) } + if i.CreatedBy != nil { + predicates = append(predicates, origin.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, origin.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, origin.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, origin.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, origin.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, origin.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, origin.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, origin.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, origin.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, origin.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, origin.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, origin.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, origin.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, origin.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, origin.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, origin.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, origin.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, origin.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, origin.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, origin.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, origin.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, origin.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, origin.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, origin.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, origin.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, origin.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, origin.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, origin.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, origin.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, origin.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } if i.Name != nil { predicates = append(predicates, origin.NameEQ(*i.Name)) } @@ -757,6 +1005,40 @@ type LoadBalancerPoolWhereInput struct { UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // "name" field predicates. Name *string `json:"name,omitempty"` NameNEQ *string `json:"nameNEQ,omitempty"` @@ -930,6 +1212,96 @@ func (i *LoadBalancerPoolWhereInput) P() (predicate.Pool, error) { if i.UpdatedAtLTE != nil { predicates = append(predicates, pool.UpdatedAtLTE(*i.UpdatedAtLTE)) } + if i.CreatedBy != nil { + predicates = append(predicates, pool.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, pool.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, pool.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, pool.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, pool.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, pool.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, pool.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, pool.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, pool.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, pool.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, pool.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, pool.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, pool.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, pool.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, pool.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, pool.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, pool.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, pool.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, pool.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, pool.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, pool.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, pool.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, pool.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, pool.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, pool.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, pool.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, pool.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, pool.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, pool.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, pool.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } if i.Name != nil { predicates = append(predicates, pool.NameEQ(*i.Name)) } @@ -1065,6 +1437,40 @@ type LoadBalancerPortWhereInput struct { UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // "number" field predicates. Number *int `json:"number,omitempty"` NumberNEQ *int `json:"numberNEQ,omitempty"` @@ -1242,6 +1648,96 @@ func (i *LoadBalancerPortWhereInput) P() (predicate.Port, error) { if i.UpdatedAtLTE != nil { predicates = append(predicates, port.UpdatedAtLTE(*i.UpdatedAtLTE)) } + if i.CreatedBy != nil { + predicates = append(predicates, port.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, port.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, port.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, port.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, port.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, port.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, port.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, port.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, port.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, port.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, port.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, port.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, port.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, port.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, port.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, port.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, port.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, port.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, port.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, port.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, port.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, port.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, port.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, port.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, port.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, port.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, port.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, port.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, port.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, port.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } if i.Number != nil { predicates = append(predicates, port.NumberEQ(*i.Number)) } @@ -1389,6 +1885,40 @@ type LoadBalancerProviderWhereInput struct { UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // "name" field predicates. Name *string `json:"name,omitempty"` NameNEQ *string `json:"nameNEQ,omitempty"` @@ -1552,6 +2082,96 @@ func (i *LoadBalancerProviderWhereInput) P() (predicate.Provider, error) { if i.UpdatedAtLTE != nil { predicates = append(predicates, provider.UpdatedAtLTE(*i.UpdatedAtLTE)) } + if i.CreatedBy != nil { + predicates = append(predicates, provider.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, provider.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, provider.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, provider.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, provider.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, provider.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, provider.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, provider.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, provider.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, provider.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, provider.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, provider.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, provider.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, provider.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, provider.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, provider.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, provider.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, provider.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, provider.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, provider.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, provider.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, provider.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, provider.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, provider.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, provider.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, provider.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, provider.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, provider.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, provider.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, provider.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } if i.Name != nil { predicates = append(predicates, provider.NameEQ(*i.Name)) } diff --git a/internal/ent/generated/loadbalancer.go b/internal/ent/generated/loadbalancer.go index bd5682a9b..aa0a934a1 100644 --- a/internal/ent/generated/loadbalancer.go +++ b/internal/ent/generated/loadbalancer.go @@ -38,6 +38,10 @@ type LoadBalancer struct { CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` // The name of the load balancer. Name string `json:"name,omitempty"` // The ID for the owner for this load balancer. @@ -96,7 +100,7 @@ func (*LoadBalancer) scanValues(columns []string) ([]any, error) { switch columns[i] { case loadbalancer.FieldID, loadbalancer.FieldOwnerID, loadbalancer.FieldLocationID, loadbalancer.FieldProviderID: values[i] = new(gidx.PrefixedID) - case loadbalancer.FieldName: + case loadbalancer.FieldCreatedBy, loadbalancer.FieldUpdatedBy, loadbalancer.FieldName: values[i] = new(sql.NullString) case loadbalancer.FieldCreatedAt, loadbalancer.FieldUpdatedAt: values[i] = new(sql.NullTime) @@ -133,6 +137,18 @@ func (lb *LoadBalancer) assignValues(columns []string, values []any) error { } else if value.Valid { lb.UpdatedAt = value.Time } + case loadbalancer.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + lb.CreatedBy = value.String + } + case loadbalancer.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + lb.UpdatedBy = value.String + } case loadbalancer.FieldName: if value, ok := values[i].(*sql.NullString); !ok { return fmt.Errorf("unexpected type %T for field name", values[i]) @@ -209,6 +225,12 @@ func (lb *LoadBalancer) String() string { builder.WriteString("updated_at=") builder.WriteString(lb.UpdatedAt.Format(time.ANSIC)) builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(lb.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(lb.UpdatedBy) + builder.WriteString(", ") builder.WriteString("name=") builder.WriteString(lb.Name) builder.WriteString(", ") diff --git a/internal/ent/generated/loadbalancer/loadbalancer.go b/internal/ent/generated/loadbalancer/loadbalancer.go index 9f1f03a1e..20378cab3 100644 --- a/internal/ent/generated/loadbalancer/loadbalancer.go +++ b/internal/ent/generated/loadbalancer/loadbalancer.go @@ -19,6 +19,7 @@ package loadbalancer import ( "time" + "entgo.io/ent" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "go.infratographer.com/x/gidx" @@ -33,6 +34,10 @@ const ( FieldCreatedAt = "created_at" // FieldUpdatedAt holds the string denoting the updated_at field in the database. FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" // FieldName holds the string denoting the name field in the database. FieldName = "name" // FieldOwnerID holds the string denoting the owner_id field in the database. @@ -68,6 +73,8 @@ var Columns = []string{ FieldID, FieldCreatedAt, FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, FieldName, FieldOwnerID, FieldLocationID, @@ -84,7 +91,13 @@ func ValidColumn(column string) bool { return false } +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" var ( + Hooks [1]ent.Hook // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. @@ -121,6 +134,16 @@ func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() } +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + // ByName orders the results by the name field. func ByName(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldName, opts...).ToFunc() diff --git a/internal/ent/generated/loadbalancer/where.go b/internal/ent/generated/loadbalancer/where.go index 0e5fab52e..6945df04b 100644 --- a/internal/ent/generated/loadbalancer/where.go +++ b/internal/ent/generated/loadbalancer/where.go @@ -80,6 +80,16 @@ func UpdatedAt(v time.Time) predicate.LoadBalancer { return predicate.LoadBalancer(sql.FieldEQ(FieldUpdatedAt, v)) } +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldEQ(FieldUpdatedBy, v)) +} + // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.LoadBalancer { return predicate.LoadBalancer(sql.FieldEQ(FieldName, v)) @@ -180,6 +190,156 @@ func UpdatedAtLTE(v time.Time) predicate.LoadBalancer { return predicate.LoadBalancer(sql.FieldLTE(FieldUpdatedAt, v)) } +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.LoadBalancer { + return predicate.LoadBalancer(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.LoadBalancer { return predicate.LoadBalancer(sql.FieldEQ(FieldName, v)) diff --git a/internal/ent/generated/loadbalancer_create.go b/internal/ent/generated/loadbalancer_create.go index 1418d874b..04154c7e7 100644 --- a/internal/ent/generated/loadbalancer_create.go +++ b/internal/ent/generated/loadbalancer_create.go @@ -65,6 +65,34 @@ func (lbc *LoadBalancerCreate) SetNillableUpdatedAt(t *time.Time) *LoadBalancerC return lbc } +// SetCreatedBy sets the "created_by" field. +func (lbc *LoadBalancerCreate) SetCreatedBy(s string) *LoadBalancerCreate { + lbc.mutation.SetCreatedBy(s) + return lbc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (lbc *LoadBalancerCreate) SetNillableCreatedBy(s *string) *LoadBalancerCreate { + if s != nil { + lbc.SetCreatedBy(*s) + } + return lbc +} + +// SetUpdatedBy sets the "updated_by" field. +func (lbc *LoadBalancerCreate) SetUpdatedBy(s string) *LoadBalancerCreate { + lbc.mutation.SetUpdatedBy(s) + return lbc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (lbc *LoadBalancerCreate) SetNillableUpdatedBy(s *string) *LoadBalancerCreate { + if s != nil { + lbc.SetUpdatedBy(*s) + } + return lbc +} + // SetName sets the "name" field. func (lbc *LoadBalancerCreate) SetName(s string) *LoadBalancerCreate { lbc.mutation.SetName(s) @@ -130,7 +158,9 @@ func (lbc *LoadBalancerCreate) Mutation() *LoadBalancerMutation { // Save creates the LoadBalancer in the database. func (lbc *LoadBalancerCreate) Save(ctx context.Context) (*LoadBalancer, error) { - lbc.defaults() + if err := lbc.defaults(); err != nil { + return nil, err + } return withHooks(ctx, lbc.sqlSave, lbc.mutation, lbc.hooks) } @@ -157,19 +187,29 @@ func (lbc *LoadBalancerCreate) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (lbc *LoadBalancerCreate) defaults() { +func (lbc *LoadBalancerCreate) defaults() error { if _, ok := lbc.mutation.CreatedAt(); !ok { + if loadbalancer.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized loadbalancer.DefaultCreatedAt (forgotten import generated/runtime?)") + } v := loadbalancer.DefaultCreatedAt() lbc.mutation.SetCreatedAt(v) } if _, ok := lbc.mutation.UpdatedAt(); !ok { + if loadbalancer.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized loadbalancer.DefaultUpdatedAt (forgotten import generated/runtime?)") + } v := loadbalancer.DefaultUpdatedAt() lbc.mutation.SetUpdatedAt(v) } if _, ok := lbc.mutation.ID(); !ok { + if loadbalancer.DefaultID == nil { + return fmt.Errorf("generated: uninitialized loadbalancer.DefaultID (forgotten import generated/runtime?)") + } v := loadbalancer.DefaultID() lbc.mutation.SetID(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -258,6 +298,14 @@ func (lbc *LoadBalancerCreate) createSpec() (*LoadBalancer, *sqlgraph.CreateSpec _spec.SetField(loadbalancer.FieldUpdatedAt, field.TypeTime, value) _node.UpdatedAt = value } + if value, ok := lbc.mutation.CreatedBy(); ok { + _spec.SetField(loadbalancer.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := lbc.mutation.UpdatedBy(); ok { + _spec.SetField(loadbalancer.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } if value, ok := lbc.mutation.Name(); ok { _spec.SetField(loadbalancer.FieldName, field.TypeString, value) _node.Name = value diff --git a/internal/ent/generated/loadbalancer_update.go b/internal/ent/generated/loadbalancer_update.go index ac741b4ce..02dd0d9ef 100644 --- a/internal/ent/generated/loadbalancer_update.go +++ b/internal/ent/generated/loadbalancer_update.go @@ -43,6 +43,26 @@ func (lbu *LoadBalancerUpdate) Where(ps ...predicate.LoadBalancer) *LoadBalancer return lbu } +// SetUpdatedBy sets the "updated_by" field. +func (lbu *LoadBalancerUpdate) SetUpdatedBy(s string) *LoadBalancerUpdate { + lbu.mutation.SetUpdatedBy(s) + return lbu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (lbu *LoadBalancerUpdate) SetNillableUpdatedBy(s *string) *LoadBalancerUpdate { + if s != nil { + lbu.SetUpdatedBy(*s) + } + return lbu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (lbu *LoadBalancerUpdate) ClearUpdatedBy() *LoadBalancerUpdate { + lbu.mutation.ClearUpdatedBy() + return lbu +} + // SetName sets the "name" field. func (lbu *LoadBalancerUpdate) SetName(s string) *LoadBalancerUpdate { lbu.mutation.SetName(s) @@ -92,7 +112,9 @@ func (lbu *LoadBalancerUpdate) RemovePorts(p ...*Port) *LoadBalancerUpdate { // Save executes the query and returns the number of nodes affected by the update operation. func (lbu *LoadBalancerUpdate) Save(ctx context.Context) (int, error) { - lbu.defaults() + if err := lbu.defaults(); err != nil { + return 0, err + } return withHooks(ctx, lbu.sqlSave, lbu.mutation, lbu.hooks) } @@ -119,11 +141,15 @@ func (lbu *LoadBalancerUpdate) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (lbu *LoadBalancerUpdate) defaults() { +func (lbu *LoadBalancerUpdate) defaults() error { if _, ok := lbu.mutation.UpdatedAt(); !ok { + if loadbalancer.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized loadbalancer.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } v := loadbalancer.UpdateDefaultUpdatedAt() lbu.mutation.SetUpdatedAt(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -154,6 +180,15 @@ func (lbu *LoadBalancerUpdate) sqlSave(ctx context.Context) (n int, err error) { if value, ok := lbu.mutation.UpdatedAt(); ok { _spec.SetField(loadbalancer.FieldUpdatedAt, field.TypeTime, value) } + if lbu.mutation.CreatedByCleared() { + _spec.ClearField(loadbalancer.FieldCreatedBy, field.TypeString) + } + if value, ok := lbu.mutation.UpdatedBy(); ok { + _spec.SetField(loadbalancer.FieldUpdatedBy, field.TypeString, value) + } + if lbu.mutation.UpdatedByCleared() { + _spec.ClearField(loadbalancer.FieldUpdatedBy, field.TypeString) + } if value, ok := lbu.mutation.Name(); ok { _spec.SetField(loadbalancer.FieldName, field.TypeString, value) } @@ -222,6 +257,26 @@ type LoadBalancerUpdateOne struct { mutation *LoadBalancerMutation } +// SetUpdatedBy sets the "updated_by" field. +func (lbuo *LoadBalancerUpdateOne) SetUpdatedBy(s string) *LoadBalancerUpdateOne { + lbuo.mutation.SetUpdatedBy(s) + return lbuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (lbuo *LoadBalancerUpdateOne) SetNillableUpdatedBy(s *string) *LoadBalancerUpdateOne { + if s != nil { + lbuo.SetUpdatedBy(*s) + } + return lbuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (lbuo *LoadBalancerUpdateOne) ClearUpdatedBy() *LoadBalancerUpdateOne { + lbuo.mutation.ClearUpdatedBy() + return lbuo +} + // SetName sets the "name" field. func (lbuo *LoadBalancerUpdateOne) SetName(s string) *LoadBalancerUpdateOne { lbuo.mutation.SetName(s) @@ -284,7 +339,9 @@ func (lbuo *LoadBalancerUpdateOne) Select(field string, fields ...string) *LoadB // Save executes the query and returns the updated LoadBalancer entity. func (lbuo *LoadBalancerUpdateOne) Save(ctx context.Context) (*LoadBalancer, error) { - lbuo.defaults() + if err := lbuo.defaults(); err != nil { + return nil, err + } return withHooks(ctx, lbuo.sqlSave, lbuo.mutation, lbuo.hooks) } @@ -311,11 +368,15 @@ func (lbuo *LoadBalancerUpdateOne) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (lbuo *LoadBalancerUpdateOne) defaults() { +func (lbuo *LoadBalancerUpdateOne) defaults() error { if _, ok := lbuo.mutation.UpdatedAt(); !ok { + if loadbalancer.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized loadbalancer.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } v := loadbalancer.UpdateDefaultUpdatedAt() lbuo.mutation.SetUpdatedAt(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -363,6 +424,15 @@ func (lbuo *LoadBalancerUpdateOne) sqlSave(ctx context.Context) (_node *LoadBala if value, ok := lbuo.mutation.UpdatedAt(); ok { _spec.SetField(loadbalancer.FieldUpdatedAt, field.TypeTime, value) } + if lbuo.mutation.CreatedByCleared() { + _spec.ClearField(loadbalancer.FieldCreatedBy, field.TypeString) + } + if value, ok := lbuo.mutation.UpdatedBy(); ok { + _spec.SetField(loadbalancer.FieldUpdatedBy, field.TypeString, value) + } + if lbuo.mutation.UpdatedByCleared() { + _spec.ClearField(loadbalancer.FieldUpdatedBy, field.TypeString) + } if value, ok := lbuo.mutation.Name(); ok { _spec.SetField(loadbalancer.FieldName, field.TypeString, value) } diff --git a/internal/ent/generated/migrate/schema.go b/internal/ent/generated/migrate/schema.go index 3af7f748a..d776c9008 100644 --- a/internal/ent/generated/migrate/schema.go +++ b/internal/ent/generated/migrate/schema.go @@ -27,6 +27,8 @@ var ( {Name: "id", Type: field.TypeString, Unique: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString, Size: 2147483647}, {Name: "owner_id", Type: field.TypeString}, {Name: "location_id", Type: field.TypeString}, @@ -40,7 +42,7 @@ var ( ForeignKeys: []*schema.ForeignKey{ { Symbol: "load_balancers_providers_provider", - Columns: []*schema.Column{LoadBalancersColumns[6]}, + Columns: []*schema.Column{LoadBalancersColumns[8]}, RefColumns: []*schema.Column{ProvidersColumns[0]}, OnDelete: schema.NoAction, }, @@ -59,17 +61,17 @@ var ( { Name: "loadbalancer_provider_id", Unique: false, - Columns: []*schema.Column{LoadBalancersColumns[6]}, + Columns: []*schema.Column{LoadBalancersColumns[8]}, }, { Name: "loadbalancer_location_id", Unique: false, - Columns: []*schema.Column{LoadBalancersColumns[5]}, + Columns: []*schema.Column{LoadBalancersColumns[7]}, }, { Name: "loadbalancer_owner_id", Unique: false, - Columns: []*schema.Column{LoadBalancersColumns[4]}, + Columns: []*schema.Column{LoadBalancersColumns[6]}, }, }, } @@ -78,6 +80,8 @@ var ( {Name: "id", Type: field.TypeString, Unique: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "weight", Type: field.TypeInt32, Default: 100}, {Name: "target", Type: field.TypeString}, @@ -93,7 +97,7 @@ var ( ForeignKeys: []*schema.ForeignKey{ { Symbol: "origins_pools_pool", - Columns: []*schema.Column{OriginsColumns[8]}, + Columns: []*schema.Column{OriginsColumns[10]}, RefColumns: []*schema.Column{PoolsColumns[0]}, OnDelete: schema.NoAction, }, @@ -112,7 +116,7 @@ var ( { Name: "origin_pool_id", Unique: false, - Columns: []*schema.Column{OriginsColumns[8]}, + Columns: []*schema.Column{OriginsColumns[10]}, }, }, } @@ -121,6 +125,8 @@ var ( {Name: "id", Type: field.TypeString, Unique: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "protocol", Type: field.TypeEnum, Enums: []string{"tcp", "udp"}}, {Name: "owner_id", Type: field.TypeString}, @@ -144,7 +150,7 @@ var ( { Name: "pool_owner_id", Unique: false, - Columns: []*schema.Column{PoolsColumns[5]}, + Columns: []*schema.Column{PoolsColumns[7]}, }, }, } @@ -153,6 +159,8 @@ var ( {Name: "id", Type: field.TypeString, Unique: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "number", Type: field.TypeInt}, {Name: "name", Type: field.TypeString}, {Name: "load_balancer_id", Type: field.TypeString}, @@ -165,7 +173,7 @@ var ( ForeignKeys: []*schema.ForeignKey{ { Symbol: "ports_load_balancers_load_balancer", - Columns: []*schema.Column{PortsColumns[5]}, + Columns: []*schema.Column{PortsColumns[7]}, RefColumns: []*schema.Column{LoadBalancersColumns[0]}, OnDelete: schema.NoAction, }, @@ -184,12 +192,12 @@ var ( { Name: "port_load_balancer_id", Unique: false, - Columns: []*schema.Column{PortsColumns[5]}, + Columns: []*schema.Column{PortsColumns[7]}, }, { Name: "port_load_balancer_id_number", Unique: true, - Columns: []*schema.Column{PortsColumns[5], PortsColumns[3]}, + Columns: []*schema.Column{PortsColumns[7], PortsColumns[5]}, }, }, } @@ -198,6 +206,8 @@ var ( {Name: "id", Type: field.TypeString, Unique: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "owner_id", Type: field.TypeString}, } @@ -220,7 +230,7 @@ var ( { Name: "provider_owner_id", Unique: false, - Columns: []*schema.Column{ProvidersColumns[4]}, + Columns: []*schema.Column{ProvidersColumns[6]}, }, }, } diff --git a/internal/ent/generated/mutation.go b/internal/ent/generated/mutation.go index 404173fcf..c7e9c921b 100644 --- a/internal/ent/generated/mutation.go +++ b/internal/ent/generated/mutation.go @@ -58,6 +58,8 @@ type LoadBalancerMutation struct { id *gidx.PrefixedID created_at *time.Time updated_at *time.Time + created_by *string + updated_by *string name *string owner_id *gidx.PrefixedID location_id *gidx.PrefixedID @@ -248,6 +250,104 @@ func (m *LoadBalancerMutation) ResetUpdatedAt() { m.updated_at = nil } +// SetCreatedBy sets the "created_by" field. +func (m *LoadBalancerMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *LoadBalancerMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the LoadBalancer entity. +// If the LoadBalancer object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *LoadBalancerMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *LoadBalancerMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[loadbalancer.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *LoadBalancerMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[loadbalancer.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *LoadBalancerMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, loadbalancer.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *LoadBalancerMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *LoadBalancerMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the LoadBalancer entity. +// If the LoadBalancer object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *LoadBalancerMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *LoadBalancerMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[loadbalancer.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *LoadBalancerMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[loadbalancer.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *LoadBalancerMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, loadbalancer.FieldUpdatedBy) +} + // SetName sets the "name" field. func (m *LoadBalancerMutation) SetName(s string) { m.name = &s @@ -507,13 +607,19 @@ func (m *LoadBalancerMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *LoadBalancerMutation) Fields() []string { - fields := make([]string, 0, 6) + fields := make([]string, 0, 8) if m.created_at != nil { fields = append(fields, loadbalancer.FieldCreatedAt) } if m.updated_at != nil { fields = append(fields, loadbalancer.FieldUpdatedAt) } + if m.created_by != nil { + fields = append(fields, loadbalancer.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, loadbalancer.FieldUpdatedBy) + } if m.name != nil { fields = append(fields, loadbalancer.FieldName) } @@ -538,6 +644,10 @@ func (m *LoadBalancerMutation) Field(name string) (ent.Value, bool) { return m.CreatedAt() case loadbalancer.FieldUpdatedAt: return m.UpdatedAt() + case loadbalancer.FieldCreatedBy: + return m.CreatedBy() + case loadbalancer.FieldUpdatedBy: + return m.UpdatedBy() case loadbalancer.FieldName: return m.Name() case loadbalancer.FieldOwnerID: @@ -559,6 +669,10 @@ func (m *LoadBalancerMutation) OldField(ctx context.Context, name string) (ent.V return m.OldCreatedAt(ctx) case loadbalancer.FieldUpdatedAt: return m.OldUpdatedAt(ctx) + case loadbalancer.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case loadbalancer.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) case loadbalancer.FieldName: return m.OldName(ctx) case loadbalancer.FieldOwnerID: @@ -590,6 +704,20 @@ func (m *LoadBalancerMutation) SetField(name string, value ent.Value) error { } m.SetUpdatedAt(v) return nil + case loadbalancer.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case loadbalancer.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil case loadbalancer.FieldName: v, ok := value.(string) if !ok { @@ -647,7 +775,14 @@ func (m *LoadBalancerMutation) AddField(name string, value ent.Value) error { // ClearedFields returns all nullable fields that were cleared during this // mutation. func (m *LoadBalancerMutation) ClearedFields() []string { - return nil + var fields []string + if m.FieldCleared(loadbalancer.FieldCreatedBy) { + fields = append(fields, loadbalancer.FieldCreatedBy) + } + if m.FieldCleared(loadbalancer.FieldUpdatedBy) { + fields = append(fields, loadbalancer.FieldUpdatedBy) + } + return fields } // FieldCleared returns a boolean indicating if a field with the given name was @@ -660,6 +795,14 @@ func (m *LoadBalancerMutation) FieldCleared(name string) bool { // ClearField clears the value of the field with the given name. It returns an // error if the field is not defined in the schema. func (m *LoadBalancerMutation) ClearField(name string) error { + switch name { + case loadbalancer.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case loadbalancer.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + } return fmt.Errorf("unknown LoadBalancer nullable field %s", name) } @@ -673,6 +816,12 @@ func (m *LoadBalancerMutation) ResetField(name string) error { case loadbalancer.FieldUpdatedAt: m.ResetUpdatedAt() return nil + case loadbalancer.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case loadbalancer.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil case loadbalancer.FieldName: m.ResetName() return nil @@ -799,6 +948,8 @@ type OriginMutation struct { id *gidx.PrefixedID created_at *time.Time updated_at *time.Time + created_by *string + updated_by *string name *string weight *int32 addweight *int32 @@ -990,6 +1141,104 @@ func (m *OriginMutation) ResetUpdatedAt() { m.updated_at = nil } +// SetCreatedBy sets the "created_by" field. +func (m *OriginMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *OriginMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Origin entity. +// If the Origin object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OriginMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *OriginMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[origin.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *OriginMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[origin.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *OriginMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, origin.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *OriginMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *OriginMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Origin entity. +// If the Origin object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OriginMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *OriginMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[origin.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *OriginMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[origin.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *OriginMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, origin.FieldUpdatedBy) +} + // SetName sets the "name" field. func (m *OriginMutation) SetName(s string) { m.name = &s @@ -1307,13 +1556,19 @@ func (m *OriginMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *OriginMutation) Fields() []string { - fields := make([]string, 0, 8) + fields := make([]string, 0, 10) if m.created_at != nil { fields = append(fields, origin.FieldCreatedAt) } if m.updated_at != nil { fields = append(fields, origin.FieldUpdatedAt) } + if m.created_by != nil { + fields = append(fields, origin.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, origin.FieldUpdatedBy) + } if m.name != nil { fields = append(fields, origin.FieldName) } @@ -1344,6 +1599,10 @@ func (m *OriginMutation) Field(name string) (ent.Value, bool) { return m.CreatedAt() case origin.FieldUpdatedAt: return m.UpdatedAt() + case origin.FieldCreatedBy: + return m.CreatedBy() + case origin.FieldUpdatedBy: + return m.UpdatedBy() case origin.FieldName: return m.Name() case origin.FieldWeight: @@ -1369,6 +1628,10 @@ func (m *OriginMutation) OldField(ctx context.Context, name string) (ent.Value, return m.OldCreatedAt(ctx) case origin.FieldUpdatedAt: return m.OldUpdatedAt(ctx) + case origin.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case origin.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) case origin.FieldName: return m.OldName(ctx) case origin.FieldWeight: @@ -1404,6 +1667,20 @@ func (m *OriginMutation) SetField(name string, value ent.Value) error { } m.SetUpdatedAt(v) return nil + case origin.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case origin.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil case origin.FieldName: v, ok := value.(string) if !ok { @@ -1502,7 +1779,14 @@ func (m *OriginMutation) AddField(name string, value ent.Value) error { // ClearedFields returns all nullable fields that were cleared during this // mutation. func (m *OriginMutation) ClearedFields() []string { - return nil + var fields []string + if m.FieldCleared(origin.FieldCreatedBy) { + fields = append(fields, origin.FieldCreatedBy) + } + if m.FieldCleared(origin.FieldUpdatedBy) { + fields = append(fields, origin.FieldUpdatedBy) + } + return fields } // FieldCleared returns a boolean indicating if a field with the given name was @@ -1515,6 +1799,14 @@ func (m *OriginMutation) FieldCleared(name string) bool { // ClearField clears the value of the field with the given name. It returns an // error if the field is not defined in the schema. func (m *OriginMutation) ClearField(name string) error { + switch name { + case origin.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case origin.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + } return fmt.Errorf("unknown Origin nullable field %s", name) } @@ -1528,6 +1820,12 @@ func (m *OriginMutation) ResetField(name string) error { case origin.FieldUpdatedAt: m.ResetUpdatedAt() return nil + case origin.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case origin.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil case origin.FieldName: m.ResetName() return nil @@ -1632,6 +1930,8 @@ type PoolMutation struct { id *gidx.PrefixedID created_at *time.Time updated_at *time.Time + created_by *string + updated_by *string name *string protocol *pool.Protocol owner_id *gidx.PrefixedID @@ -1823,6 +2123,104 @@ func (m *PoolMutation) ResetUpdatedAt() { m.updated_at = nil } +// SetCreatedBy sets the "created_by" field. +func (m *PoolMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *PoolMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Pool entity. +// If the Pool object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PoolMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *PoolMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[pool.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *PoolMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[pool.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *PoolMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, pool.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *PoolMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *PoolMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Pool entity. +// If the Pool object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PoolMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *PoolMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[pool.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *PoolMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[pool.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *PoolMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, pool.FieldUpdatedBy) +} + // SetName sets the "name" field. func (m *PoolMutation) SetName(s string) { m.name = &s @@ -2073,13 +2471,19 @@ func (m *PoolMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *PoolMutation) Fields() []string { - fields := make([]string, 0, 5) + fields := make([]string, 0, 7) if m.created_at != nil { fields = append(fields, pool.FieldCreatedAt) } if m.updated_at != nil { fields = append(fields, pool.FieldUpdatedAt) } + if m.created_by != nil { + fields = append(fields, pool.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, pool.FieldUpdatedBy) + } if m.name != nil { fields = append(fields, pool.FieldName) } @@ -2101,6 +2505,10 @@ func (m *PoolMutation) Field(name string) (ent.Value, bool) { return m.CreatedAt() case pool.FieldUpdatedAt: return m.UpdatedAt() + case pool.FieldCreatedBy: + return m.CreatedBy() + case pool.FieldUpdatedBy: + return m.UpdatedBy() case pool.FieldName: return m.Name() case pool.FieldProtocol: @@ -2120,6 +2528,10 @@ func (m *PoolMutation) OldField(ctx context.Context, name string) (ent.Value, er return m.OldCreatedAt(ctx) case pool.FieldUpdatedAt: return m.OldUpdatedAt(ctx) + case pool.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case pool.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) case pool.FieldName: return m.OldName(ctx) case pool.FieldProtocol: @@ -2149,6 +2561,20 @@ func (m *PoolMutation) SetField(name string, value ent.Value) error { } m.SetUpdatedAt(v) return nil + case pool.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case pool.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil case pool.FieldName: v, ok := value.(string) if !ok { @@ -2199,7 +2625,14 @@ func (m *PoolMutation) AddField(name string, value ent.Value) error { // ClearedFields returns all nullable fields that were cleared during this // mutation. func (m *PoolMutation) ClearedFields() []string { - return nil + var fields []string + if m.FieldCleared(pool.FieldCreatedBy) { + fields = append(fields, pool.FieldCreatedBy) + } + if m.FieldCleared(pool.FieldUpdatedBy) { + fields = append(fields, pool.FieldUpdatedBy) + } + return fields } // FieldCleared returns a boolean indicating if a field with the given name was @@ -2212,6 +2645,14 @@ func (m *PoolMutation) FieldCleared(name string) bool { // ClearField clears the value of the field with the given name. It returns an // error if the field is not defined in the schema. func (m *PoolMutation) ClearField(name string) error { + switch name { + case pool.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case pool.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + } return fmt.Errorf("unknown Pool nullable field %s", name) } @@ -2225,6 +2666,12 @@ func (m *PoolMutation) ResetField(name string) error { case pool.FieldUpdatedAt: m.ResetUpdatedAt() return nil + case pool.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case pool.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil case pool.FieldName: m.ResetName() return nil @@ -2356,6 +2803,8 @@ type PortMutation struct { id *gidx.PrefixedID created_at *time.Time updated_at *time.Time + created_by *string + updated_by *string number *int addnumber *int name *string @@ -2546,6 +2995,104 @@ func (m *PortMutation) ResetUpdatedAt() { m.updated_at = nil } +// SetCreatedBy sets the "created_by" field. +func (m *PortMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *PortMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Port entity. +// If the Port object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PortMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *PortMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[port.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *PortMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[port.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *PortMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, port.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *PortMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *PortMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Port entity. +// If the Port object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PortMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *PortMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[port.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *PortMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[port.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *PortMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, port.FieldUpdatedBy) +} + // SetNumber sets the "number" field. func (m *PortMutation) SetNumber(i int) { m.number = &i @@ -2789,13 +3336,19 @@ func (m *PortMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *PortMutation) Fields() []string { - fields := make([]string, 0, 5) + fields := make([]string, 0, 7) if m.created_at != nil { fields = append(fields, port.FieldCreatedAt) } if m.updated_at != nil { fields = append(fields, port.FieldUpdatedAt) } + if m.created_by != nil { + fields = append(fields, port.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, port.FieldUpdatedBy) + } if m.number != nil { fields = append(fields, port.FieldNumber) } @@ -2817,6 +3370,10 @@ func (m *PortMutation) Field(name string) (ent.Value, bool) { return m.CreatedAt() case port.FieldUpdatedAt: return m.UpdatedAt() + case port.FieldCreatedBy: + return m.CreatedBy() + case port.FieldUpdatedBy: + return m.UpdatedBy() case port.FieldNumber: return m.Number() case port.FieldName: @@ -2836,6 +3393,10 @@ func (m *PortMutation) OldField(ctx context.Context, name string) (ent.Value, er return m.OldCreatedAt(ctx) case port.FieldUpdatedAt: return m.OldUpdatedAt(ctx) + case port.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case port.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) case port.FieldNumber: return m.OldNumber(ctx) case port.FieldName: @@ -2865,6 +3426,20 @@ func (m *PortMutation) SetField(name string, value ent.Value) error { } m.SetUpdatedAt(v) return nil + case port.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case port.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil case port.FieldNumber: v, ok := value.(int) if !ok { @@ -2930,7 +3505,14 @@ func (m *PortMutation) AddField(name string, value ent.Value) error { // ClearedFields returns all nullable fields that were cleared during this // mutation. func (m *PortMutation) ClearedFields() []string { - return nil + var fields []string + if m.FieldCleared(port.FieldCreatedBy) { + fields = append(fields, port.FieldCreatedBy) + } + if m.FieldCleared(port.FieldUpdatedBy) { + fields = append(fields, port.FieldUpdatedBy) + } + return fields } // FieldCleared returns a boolean indicating if a field with the given name was @@ -2943,6 +3525,14 @@ func (m *PortMutation) FieldCleared(name string) bool { // ClearField clears the value of the field with the given name. It returns an // error if the field is not defined in the schema. func (m *PortMutation) ClearField(name string) error { + switch name { + case port.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case port.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + } return fmt.Errorf("unknown Port nullable field %s", name) } @@ -2956,6 +3546,12 @@ func (m *PortMutation) ResetField(name string) error { case port.FieldUpdatedAt: m.ResetUpdatedAt() return nil + case port.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case port.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil case port.FieldNumber: m.ResetNumber() return nil @@ -3079,6 +3675,8 @@ type ProviderMutation struct { id *gidx.PrefixedID created_at *time.Time updated_at *time.Time + created_by *string + updated_by *string name *string owner_id *gidx.PrefixedID clearedFields map[string]struct{} @@ -3266,6 +3864,104 @@ func (m *ProviderMutation) ResetUpdatedAt() { m.updated_at = nil } +// SetCreatedBy sets the "created_by" field. +func (m *ProviderMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *ProviderMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Provider entity. +// If the Provider object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ProviderMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *ProviderMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[provider.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *ProviderMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[provider.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *ProviderMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, provider.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *ProviderMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *ProviderMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Provider entity. +// If the Provider object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ProviderMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *ProviderMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[provider.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *ProviderMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[provider.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *ProviderMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, provider.FieldUpdatedBy) +} + // SetName sets the "name" field. func (m *ProviderMutation) SetName(s string) { m.name = &s @@ -3426,13 +4122,19 @@ func (m *ProviderMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *ProviderMutation) Fields() []string { - fields := make([]string, 0, 4) + fields := make([]string, 0, 6) if m.created_at != nil { fields = append(fields, provider.FieldCreatedAt) } if m.updated_at != nil { fields = append(fields, provider.FieldUpdatedAt) } + if m.created_by != nil { + fields = append(fields, provider.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, provider.FieldUpdatedBy) + } if m.name != nil { fields = append(fields, provider.FieldName) } @@ -3451,6 +4153,10 @@ func (m *ProviderMutation) Field(name string) (ent.Value, bool) { return m.CreatedAt() case provider.FieldUpdatedAt: return m.UpdatedAt() + case provider.FieldCreatedBy: + return m.CreatedBy() + case provider.FieldUpdatedBy: + return m.UpdatedBy() case provider.FieldName: return m.Name() case provider.FieldOwnerID: @@ -3468,6 +4174,10 @@ func (m *ProviderMutation) OldField(ctx context.Context, name string) (ent.Value return m.OldCreatedAt(ctx) case provider.FieldUpdatedAt: return m.OldUpdatedAt(ctx) + case provider.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case provider.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) case provider.FieldName: return m.OldName(ctx) case provider.FieldOwnerID: @@ -3495,6 +4205,20 @@ func (m *ProviderMutation) SetField(name string, value ent.Value) error { } m.SetUpdatedAt(v) return nil + case provider.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case provider.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil case provider.FieldName: v, ok := value.(string) if !ok { @@ -3538,7 +4262,14 @@ func (m *ProviderMutation) AddField(name string, value ent.Value) error { // ClearedFields returns all nullable fields that were cleared during this // mutation. func (m *ProviderMutation) ClearedFields() []string { - return nil + var fields []string + if m.FieldCleared(provider.FieldCreatedBy) { + fields = append(fields, provider.FieldCreatedBy) + } + if m.FieldCleared(provider.FieldUpdatedBy) { + fields = append(fields, provider.FieldUpdatedBy) + } + return fields } // FieldCleared returns a boolean indicating if a field with the given name was @@ -3551,6 +4282,14 @@ func (m *ProviderMutation) FieldCleared(name string) bool { // ClearField clears the value of the field with the given name. It returns an // error if the field is not defined in the schema. func (m *ProviderMutation) ClearField(name string) error { + switch name { + case provider.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case provider.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + } return fmt.Errorf("unknown Provider nullable field %s", name) } @@ -3564,6 +4303,12 @@ func (m *ProviderMutation) ResetField(name string) error { case provider.FieldUpdatedAt: m.ResetUpdatedAt() return nil + case provider.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case provider.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil case provider.FieldName: m.ResetName() return nil diff --git a/internal/ent/generated/origin.go b/internal/ent/generated/origin.go index f22c9bedd..3e76985a9 100644 --- a/internal/ent/generated/origin.go +++ b/internal/ent/generated/origin.go @@ -37,6 +37,10 @@ type Origin struct { CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Weight holds the value of the "weight" field. @@ -90,7 +94,7 @@ func (*Origin) scanValues(columns []string) ([]any, error) { values[i] = new(sql.NullBool) case origin.FieldWeight, origin.FieldPortNumber: values[i] = new(sql.NullInt64) - case origin.FieldName, origin.FieldTarget: + case origin.FieldCreatedBy, origin.FieldUpdatedBy, origin.FieldName, origin.FieldTarget: values[i] = new(sql.NullString) case origin.FieldCreatedAt, origin.FieldUpdatedAt: values[i] = new(sql.NullTime) @@ -127,6 +131,18 @@ func (o *Origin) assignValues(columns []string, values []any) error { } else if value.Valid { o.UpdatedAt = value.Time } + case origin.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + o.CreatedBy = value.String + } + case origin.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + o.UpdatedBy = value.String + } case origin.FieldName: if value, ok := values[i].(*sql.NullString); !ok { return fmt.Errorf("unexpected type %T for field name", values[i]) @@ -210,6 +226,12 @@ func (o *Origin) String() string { builder.WriteString("updated_at=") builder.WriteString(o.UpdatedAt.Format(time.ANSIC)) builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(o.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(o.UpdatedBy) + builder.WriteString(", ") builder.WriteString("name=") builder.WriteString(o.Name) builder.WriteString(", ") diff --git a/internal/ent/generated/origin/origin.go b/internal/ent/generated/origin/origin.go index e62502948..b58f40bd4 100644 --- a/internal/ent/generated/origin/origin.go +++ b/internal/ent/generated/origin/origin.go @@ -19,6 +19,7 @@ package origin import ( "time" + "entgo.io/ent" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "go.infratographer.com/x/gidx" @@ -33,6 +34,10 @@ const ( FieldCreatedAt = "created_at" // FieldUpdatedAt holds the string denoting the updated_at field in the database. FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" // FieldName holds the string denoting the name field in the database. FieldName = "name" // FieldWeight holds the string denoting the weight field in the database. @@ -63,6 +68,8 @@ var Columns = []string{ FieldID, FieldCreatedAt, FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, FieldName, FieldWeight, FieldTarget, @@ -81,7 +88,13 @@ func ValidColumn(column string) bool { return false } +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" var ( + Hooks [1]ent.Hook // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. @@ -122,6 +135,16 @@ func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() } +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + // ByName orders the results by the name field. func ByName(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldName, opts...).ToFunc() diff --git a/internal/ent/generated/origin/where.go b/internal/ent/generated/origin/where.go index 2bc8efc51..cd7addf09 100644 --- a/internal/ent/generated/origin/where.go +++ b/internal/ent/generated/origin/where.go @@ -80,6 +80,16 @@ func UpdatedAt(v time.Time) predicate.Origin { return predicate.Origin(sql.FieldEQ(FieldUpdatedAt, v)) } +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Origin { + return predicate.Origin(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Origin { + return predicate.Origin(sql.FieldEQ(FieldUpdatedBy, v)) +} + // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Origin { return predicate.Origin(sql.FieldEQ(FieldName, v)) @@ -190,6 +200,156 @@ func UpdatedAtLTE(v time.Time) predicate.Origin { return predicate.Origin(sql.FieldLTE(FieldUpdatedAt, v)) } +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Origin { + return predicate.Origin(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Origin { + return predicate.Origin(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Origin { + return predicate.Origin(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Origin { + return predicate.Origin(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Origin { + return predicate.Origin(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Origin { + return predicate.Origin(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Origin { + return predicate.Origin(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Origin { + return predicate.Origin(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Origin { + return predicate.Origin(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Origin { + return predicate.Origin(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Origin { + return predicate.Origin(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Origin { + return predicate.Origin(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Origin { + return predicate.Origin(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Origin { + return predicate.Origin(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Origin { + return predicate.Origin(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Origin { + return predicate.Origin(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Origin { + return predicate.Origin(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Origin { + return predicate.Origin(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Origin { + return predicate.Origin(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Origin { + return predicate.Origin(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Origin { + return predicate.Origin(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Origin { + return predicate.Origin(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Origin { + return predicate.Origin(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Origin { + return predicate.Origin(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Origin { + return predicate.Origin(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Origin { + return predicate.Origin(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Origin { + return predicate.Origin(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Origin { + return predicate.Origin(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Origin { + return predicate.Origin(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Origin { + return predicate.Origin(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Origin { return predicate.Origin(sql.FieldEQ(FieldName, v)) diff --git a/internal/ent/generated/origin_create.go b/internal/ent/generated/origin_create.go index 24b7dd441..67a75fa75 100644 --- a/internal/ent/generated/origin_create.go +++ b/internal/ent/generated/origin_create.go @@ -64,6 +64,34 @@ func (oc *OriginCreate) SetNillableUpdatedAt(t *time.Time) *OriginCreate { return oc } +// SetCreatedBy sets the "created_by" field. +func (oc *OriginCreate) SetCreatedBy(s string) *OriginCreate { + oc.mutation.SetCreatedBy(s) + return oc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (oc *OriginCreate) SetNillableCreatedBy(s *string) *OriginCreate { + if s != nil { + oc.SetCreatedBy(*s) + } + return oc +} + +// SetUpdatedBy sets the "updated_by" field. +func (oc *OriginCreate) SetUpdatedBy(s string) *OriginCreate { + oc.mutation.SetUpdatedBy(s) + return oc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (oc *OriginCreate) SetNillableUpdatedBy(s *string) *OriginCreate { + if s != nil { + oc.SetUpdatedBy(*s) + } + return oc +} + // SetName sets the "name" field. func (oc *OriginCreate) SetName(s string) *OriginCreate { oc.mutation.SetName(s) @@ -142,7 +170,9 @@ func (oc *OriginCreate) Mutation() *OriginMutation { // Save creates the Origin in the database. func (oc *OriginCreate) Save(ctx context.Context) (*Origin, error) { - oc.defaults() + if err := oc.defaults(); err != nil { + return nil, err + } return withHooks(ctx, oc.sqlSave, oc.mutation, oc.hooks) } @@ -169,12 +199,18 @@ func (oc *OriginCreate) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (oc *OriginCreate) defaults() { +func (oc *OriginCreate) defaults() error { if _, ok := oc.mutation.CreatedAt(); !ok { + if origin.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized origin.DefaultCreatedAt (forgotten import generated/runtime?)") + } v := origin.DefaultCreatedAt() oc.mutation.SetCreatedAt(v) } if _, ok := oc.mutation.UpdatedAt(); !ok { + if origin.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized origin.DefaultUpdatedAt (forgotten import generated/runtime?)") + } v := origin.DefaultUpdatedAt() oc.mutation.SetUpdatedAt(v) } @@ -187,9 +223,13 @@ func (oc *OriginCreate) defaults() { oc.mutation.SetActive(v) } if _, ok := oc.mutation.ID(); !ok { + if origin.DefaultID == nil { + return fmt.Errorf("generated: uninitialized origin.DefaultID (forgotten import generated/runtime?)") + } v := origin.DefaultID() oc.mutation.SetID(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -284,6 +324,14 @@ func (oc *OriginCreate) createSpec() (*Origin, *sqlgraph.CreateSpec) { _spec.SetField(origin.FieldUpdatedAt, field.TypeTime, value) _node.UpdatedAt = value } + if value, ok := oc.mutation.CreatedBy(); ok { + _spec.SetField(origin.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := oc.mutation.UpdatedBy(); ok { + _spec.SetField(origin.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } if value, ok := oc.mutation.Name(); ok { _spec.SetField(origin.FieldName, field.TypeString, value) _node.Name = value diff --git a/internal/ent/generated/origin_update.go b/internal/ent/generated/origin_update.go index bdddf0551..117c2af48 100644 --- a/internal/ent/generated/origin_update.go +++ b/internal/ent/generated/origin_update.go @@ -41,6 +41,26 @@ func (ou *OriginUpdate) Where(ps ...predicate.Origin) *OriginUpdate { return ou } +// SetUpdatedBy sets the "updated_by" field. +func (ou *OriginUpdate) SetUpdatedBy(s string) *OriginUpdate { + ou.mutation.SetUpdatedBy(s) + return ou +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ou *OriginUpdate) SetNillableUpdatedBy(s *string) *OriginUpdate { + if s != nil { + ou.SetUpdatedBy(*s) + } + return ou +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ou *OriginUpdate) ClearUpdatedBy() *OriginUpdate { + ou.mutation.ClearUpdatedBy() + return ou +} + // SetName sets the "name" field. func (ou *OriginUpdate) SetName(s string) *OriginUpdate { ou.mutation.SetName(s) @@ -108,7 +128,9 @@ func (ou *OriginUpdate) Mutation() *OriginMutation { // Save executes the query and returns the number of nodes affected by the update operation. func (ou *OriginUpdate) Save(ctx context.Context) (int, error) { - ou.defaults() + if err := ou.defaults(); err != nil { + return 0, err + } return withHooks(ctx, ou.sqlSave, ou.mutation, ou.hooks) } @@ -135,11 +157,15 @@ func (ou *OriginUpdate) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (ou *OriginUpdate) defaults() { +func (ou *OriginUpdate) defaults() error { if _, ok := ou.mutation.UpdatedAt(); !ok { + if origin.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized origin.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } v := origin.UpdateDefaultUpdatedAt() ou.mutation.SetUpdatedAt(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -180,6 +206,15 @@ func (ou *OriginUpdate) sqlSave(ctx context.Context) (n int, err error) { if value, ok := ou.mutation.UpdatedAt(); ok { _spec.SetField(origin.FieldUpdatedAt, field.TypeTime, value) } + if ou.mutation.CreatedByCleared() { + _spec.ClearField(origin.FieldCreatedBy, field.TypeString) + } + if value, ok := ou.mutation.UpdatedBy(); ok { + _spec.SetField(origin.FieldUpdatedBy, field.TypeString, value) + } + if ou.mutation.UpdatedByCleared() { + _spec.ClearField(origin.FieldUpdatedBy, field.TypeString) + } if value, ok := ou.mutation.Name(); ok { _spec.SetField(origin.FieldName, field.TypeString, value) } @@ -221,6 +256,26 @@ type OriginUpdateOne struct { mutation *OriginMutation } +// SetUpdatedBy sets the "updated_by" field. +func (ouo *OriginUpdateOne) SetUpdatedBy(s string) *OriginUpdateOne { + ouo.mutation.SetUpdatedBy(s) + return ouo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ouo *OriginUpdateOne) SetNillableUpdatedBy(s *string) *OriginUpdateOne { + if s != nil { + ouo.SetUpdatedBy(*s) + } + return ouo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ouo *OriginUpdateOne) ClearUpdatedBy() *OriginUpdateOne { + ouo.mutation.ClearUpdatedBy() + return ouo +} + // SetName sets the "name" field. func (ouo *OriginUpdateOne) SetName(s string) *OriginUpdateOne { ouo.mutation.SetName(s) @@ -301,7 +356,9 @@ func (ouo *OriginUpdateOne) Select(field string, fields ...string) *OriginUpdate // Save executes the query and returns the updated Origin entity. func (ouo *OriginUpdateOne) Save(ctx context.Context) (*Origin, error) { - ouo.defaults() + if err := ouo.defaults(); err != nil { + return nil, err + } return withHooks(ctx, ouo.sqlSave, ouo.mutation, ouo.hooks) } @@ -328,11 +385,15 @@ func (ouo *OriginUpdateOne) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (ouo *OriginUpdateOne) defaults() { +func (ouo *OriginUpdateOne) defaults() error { if _, ok := ouo.mutation.UpdatedAt(); !ok { + if origin.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized origin.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } v := origin.UpdateDefaultUpdatedAt() ouo.mutation.SetUpdatedAt(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -390,6 +451,15 @@ func (ouo *OriginUpdateOne) sqlSave(ctx context.Context) (_node *Origin, err err if value, ok := ouo.mutation.UpdatedAt(); ok { _spec.SetField(origin.FieldUpdatedAt, field.TypeTime, value) } + if ouo.mutation.CreatedByCleared() { + _spec.ClearField(origin.FieldCreatedBy, field.TypeString) + } + if value, ok := ouo.mutation.UpdatedBy(); ok { + _spec.SetField(origin.FieldUpdatedBy, field.TypeString, value) + } + if ouo.mutation.UpdatedByCleared() { + _spec.ClearField(origin.FieldUpdatedBy, field.TypeString) + } if value, ok := ouo.mutation.Name(); ok { _spec.SetField(origin.FieldName, field.TypeString, value) } diff --git a/internal/ent/generated/pool.go b/internal/ent/generated/pool.go index 6fb38ab55..34f88a7bf 100644 --- a/internal/ent/generated/pool.go +++ b/internal/ent/generated/pool.go @@ -36,6 +36,10 @@ type Pool struct { CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Protocol holds the value of the "protocol" field. @@ -89,7 +93,7 @@ func (*Pool) scanValues(columns []string) ([]any, error) { switch columns[i] { case pool.FieldID, pool.FieldOwnerID: values[i] = new(gidx.PrefixedID) - case pool.FieldName, pool.FieldProtocol: + case pool.FieldCreatedBy, pool.FieldUpdatedBy, pool.FieldName, pool.FieldProtocol: values[i] = new(sql.NullString) case pool.FieldCreatedAt, pool.FieldUpdatedAt: values[i] = new(sql.NullTime) @@ -126,6 +130,18 @@ func (po *Pool) assignValues(columns []string, values []any) error { } else if value.Valid { po.UpdatedAt = value.Time } + case pool.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + po.CreatedBy = value.String + } + case pool.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + po.UpdatedBy = value.String + } case pool.FieldName: if value, ok := values[i].(*sql.NullString); !ok { return fmt.Errorf("unexpected type %T for field name", values[i]) @@ -196,6 +212,12 @@ func (po *Pool) String() string { builder.WriteString("updated_at=") builder.WriteString(po.UpdatedAt.Format(time.ANSIC)) builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(po.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(po.UpdatedBy) + builder.WriteString(", ") builder.WriteString("name=") builder.WriteString(po.Name) builder.WriteString(", ") diff --git a/internal/ent/generated/pool/pool.go b/internal/ent/generated/pool/pool.go index 578fabf70..0720b3d02 100644 --- a/internal/ent/generated/pool/pool.go +++ b/internal/ent/generated/pool/pool.go @@ -22,6 +22,7 @@ import ( "strconv" "time" + "entgo.io/ent" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "go.infratographer.com/x/gidx" @@ -36,6 +37,10 @@ const ( FieldCreatedAt = "created_at" // FieldUpdatedAt holds the string denoting the updated_at field in the database. FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" // FieldName holds the string denoting the name field in the database. FieldName = "name" // FieldProtocol holds the string denoting the protocol field in the database. @@ -67,6 +72,8 @@ var Columns = []string{ FieldID, FieldCreatedAt, FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, FieldName, FieldProtocol, FieldOwnerID, @@ -88,7 +95,13 @@ func ValidColumn(column string) bool { return false } +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" var ( + Hooks [1]ent.Hook // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. @@ -144,6 +157,16 @@ func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() } +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + // ByName orders the results by the name field. func ByName(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldName, opts...).ToFunc() diff --git a/internal/ent/generated/pool/where.go b/internal/ent/generated/pool/where.go index f8ebe2b11..f5771610a 100644 --- a/internal/ent/generated/pool/where.go +++ b/internal/ent/generated/pool/where.go @@ -80,6 +80,16 @@ func UpdatedAt(v time.Time) predicate.Pool { return predicate.Pool(sql.FieldEQ(FieldUpdatedAt, v)) } +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Pool { + return predicate.Pool(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Pool { + return predicate.Pool(sql.FieldEQ(FieldUpdatedBy, v)) +} + // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Pool { return predicate.Pool(sql.FieldEQ(FieldName, v)) @@ -170,6 +180,156 @@ func UpdatedAtLTE(v time.Time) predicate.Pool { return predicate.Pool(sql.FieldLTE(FieldUpdatedAt, v)) } +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Pool { + return predicate.Pool(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Pool { + return predicate.Pool(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Pool { + return predicate.Pool(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Pool { + return predicate.Pool(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Pool { + return predicate.Pool(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Pool { + return predicate.Pool(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Pool { + return predicate.Pool(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Pool { + return predicate.Pool(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Pool { + return predicate.Pool(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Pool { + return predicate.Pool(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Pool { + return predicate.Pool(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Pool { + return predicate.Pool(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Pool { + return predicate.Pool(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Pool { + return predicate.Pool(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Pool { + return predicate.Pool(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Pool { + return predicate.Pool(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Pool { + return predicate.Pool(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Pool { + return predicate.Pool(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Pool { + return predicate.Pool(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Pool { + return predicate.Pool(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Pool { + return predicate.Pool(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Pool { + return predicate.Pool(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Pool { + return predicate.Pool(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Pool { + return predicate.Pool(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Pool { + return predicate.Pool(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Pool { + return predicate.Pool(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Pool { + return predicate.Pool(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Pool { + return predicate.Pool(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Pool { + return predicate.Pool(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Pool { + return predicate.Pool(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Pool { return predicate.Pool(sql.FieldEQ(FieldName, v)) diff --git a/internal/ent/generated/pool_create.go b/internal/ent/generated/pool_create.go index 138688174..eeb2fac7d 100644 --- a/internal/ent/generated/pool_create.go +++ b/internal/ent/generated/pool_create.go @@ -65,6 +65,34 @@ func (pc *PoolCreate) SetNillableUpdatedAt(t *time.Time) *PoolCreate { return pc } +// SetCreatedBy sets the "created_by" field. +func (pc *PoolCreate) SetCreatedBy(s string) *PoolCreate { + pc.mutation.SetCreatedBy(s) + return pc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (pc *PoolCreate) SetNillableCreatedBy(s *string) *PoolCreate { + if s != nil { + pc.SetCreatedBy(*s) + } + return pc +} + +// SetUpdatedBy sets the "updated_by" field. +func (pc *PoolCreate) SetUpdatedBy(s string) *PoolCreate { + pc.mutation.SetUpdatedBy(s) + return pc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (pc *PoolCreate) SetNillableUpdatedBy(s *string) *PoolCreate { + if s != nil { + pc.SetUpdatedBy(*s) + } + return pc +} + // SetName sets the "name" field. func (pc *PoolCreate) SetName(s string) *PoolCreate { pc.mutation.SetName(s) @@ -134,7 +162,9 @@ func (pc *PoolCreate) Mutation() *PoolMutation { // Save creates the Pool in the database. func (pc *PoolCreate) Save(ctx context.Context) (*Pool, error) { - pc.defaults() + if err := pc.defaults(); err != nil { + return nil, err + } return withHooks(ctx, pc.sqlSave, pc.mutation, pc.hooks) } @@ -161,19 +191,29 @@ func (pc *PoolCreate) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (pc *PoolCreate) defaults() { +func (pc *PoolCreate) defaults() error { if _, ok := pc.mutation.CreatedAt(); !ok { + if pool.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized pool.DefaultCreatedAt (forgotten import generated/runtime?)") + } v := pool.DefaultCreatedAt() pc.mutation.SetCreatedAt(v) } if _, ok := pc.mutation.UpdatedAt(); !ok { + if pool.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized pool.DefaultUpdatedAt (forgotten import generated/runtime?)") + } v := pool.DefaultUpdatedAt() pc.mutation.SetUpdatedAt(v) } if _, ok := pc.mutation.ID(); !ok { + if pool.DefaultID == nil { + return fmt.Errorf("generated: uninitialized pool.DefaultID (forgotten import generated/runtime?)") + } v := pool.DefaultID() pc.mutation.SetID(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -251,6 +291,14 @@ func (pc *PoolCreate) createSpec() (*Pool, *sqlgraph.CreateSpec) { _spec.SetField(pool.FieldUpdatedAt, field.TypeTime, value) _node.UpdatedAt = value } + if value, ok := pc.mutation.CreatedBy(); ok { + _spec.SetField(pool.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := pc.mutation.UpdatedBy(); ok { + _spec.SetField(pool.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } if value, ok := pc.mutation.Name(); ok { _spec.SetField(pool.FieldName, field.TypeString, value) _node.Name = value diff --git a/internal/ent/generated/pool_update.go b/internal/ent/generated/pool_update.go index 4703aa855..8b90681b8 100644 --- a/internal/ent/generated/pool_update.go +++ b/internal/ent/generated/pool_update.go @@ -44,6 +44,26 @@ func (pu *PoolUpdate) Where(ps ...predicate.Pool) *PoolUpdate { return pu } +// SetUpdatedBy sets the "updated_by" field. +func (pu *PoolUpdate) SetUpdatedBy(s string) *PoolUpdate { + pu.mutation.SetUpdatedBy(s) + return pu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (pu *PoolUpdate) SetNillableUpdatedBy(s *string) *PoolUpdate { + if s != nil { + pu.SetUpdatedBy(*s) + } + return pu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (pu *PoolUpdate) ClearUpdatedBy() *PoolUpdate { + pu.mutation.ClearUpdatedBy() + return pu +} + // SetName sets the "name" field. func (pu *PoolUpdate) SetName(s string) *PoolUpdate { pu.mutation.SetName(s) @@ -135,7 +155,9 @@ func (pu *PoolUpdate) RemoveOrigins(o ...*Origin) *PoolUpdate { // Save executes the query and returns the number of nodes affected by the update operation. func (pu *PoolUpdate) Save(ctx context.Context) (int, error) { - pu.defaults() + if err := pu.defaults(); err != nil { + return 0, err + } return withHooks(ctx, pu.sqlSave, pu.mutation, pu.hooks) } @@ -162,11 +184,15 @@ func (pu *PoolUpdate) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (pu *PoolUpdate) defaults() { +func (pu *PoolUpdate) defaults() error { if _, ok := pu.mutation.UpdatedAt(); !ok { + if pool.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized pool.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } v := pool.UpdateDefaultUpdatedAt() pu.mutation.SetUpdatedAt(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -199,6 +225,15 @@ func (pu *PoolUpdate) sqlSave(ctx context.Context) (n int, err error) { if value, ok := pu.mutation.UpdatedAt(); ok { _spec.SetField(pool.FieldUpdatedAt, field.TypeTime, value) } + if pu.mutation.CreatedByCleared() { + _spec.ClearField(pool.FieldCreatedBy, field.TypeString) + } + if value, ok := pu.mutation.UpdatedBy(); ok { + _spec.SetField(pool.FieldUpdatedBy, field.TypeString, value) + } + if pu.mutation.UpdatedByCleared() { + _spec.ClearField(pool.FieldUpdatedBy, field.TypeString) + } if value, ok := pu.mutation.Name(); ok { _spec.SetField(pool.FieldName, field.TypeString, value) } @@ -315,6 +350,26 @@ type PoolUpdateOne struct { mutation *PoolMutation } +// SetUpdatedBy sets the "updated_by" field. +func (puo *PoolUpdateOne) SetUpdatedBy(s string) *PoolUpdateOne { + puo.mutation.SetUpdatedBy(s) + return puo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (puo *PoolUpdateOne) SetNillableUpdatedBy(s *string) *PoolUpdateOne { + if s != nil { + puo.SetUpdatedBy(*s) + } + return puo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (puo *PoolUpdateOne) ClearUpdatedBy() *PoolUpdateOne { + puo.mutation.ClearUpdatedBy() + return puo +} + // SetName sets the "name" field. func (puo *PoolUpdateOne) SetName(s string) *PoolUpdateOne { puo.mutation.SetName(s) @@ -419,7 +474,9 @@ func (puo *PoolUpdateOne) Select(field string, fields ...string) *PoolUpdateOne // Save executes the query and returns the updated Pool entity. func (puo *PoolUpdateOne) Save(ctx context.Context) (*Pool, error) { - puo.defaults() + if err := puo.defaults(); err != nil { + return nil, err + } return withHooks(ctx, puo.sqlSave, puo.mutation, puo.hooks) } @@ -446,11 +503,15 @@ func (puo *PoolUpdateOne) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (puo *PoolUpdateOne) defaults() { +func (puo *PoolUpdateOne) defaults() error { if _, ok := puo.mutation.UpdatedAt(); !ok { + if pool.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized pool.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } v := pool.UpdateDefaultUpdatedAt() puo.mutation.SetUpdatedAt(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -500,6 +561,15 @@ func (puo *PoolUpdateOne) sqlSave(ctx context.Context) (_node *Pool, err error) if value, ok := puo.mutation.UpdatedAt(); ok { _spec.SetField(pool.FieldUpdatedAt, field.TypeTime, value) } + if puo.mutation.CreatedByCleared() { + _spec.ClearField(pool.FieldCreatedBy, field.TypeString) + } + if value, ok := puo.mutation.UpdatedBy(); ok { + _spec.SetField(pool.FieldUpdatedBy, field.TypeString, value) + } + if puo.mutation.UpdatedByCleared() { + _spec.ClearField(pool.FieldUpdatedBy, field.TypeString) + } if value, ok := puo.mutation.Name(); ok { _spec.SetField(pool.FieldName, field.TypeString, value) } diff --git a/internal/ent/generated/port.go b/internal/ent/generated/port.go index 1af1c987b..7293c1cc5 100644 --- a/internal/ent/generated/port.go +++ b/internal/ent/generated/port.go @@ -37,6 +37,10 @@ type Port struct { CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` // Number holds the value of the "number" field. Number int `json:"number,omitempty"` // Name holds the value of the "name" field. @@ -95,7 +99,7 @@ func (*Port) scanValues(columns []string) ([]any, error) { values[i] = new(gidx.PrefixedID) case port.FieldNumber: values[i] = new(sql.NullInt64) - case port.FieldName: + case port.FieldCreatedBy, port.FieldUpdatedBy, port.FieldName: values[i] = new(sql.NullString) case port.FieldCreatedAt, port.FieldUpdatedAt: values[i] = new(sql.NullTime) @@ -132,6 +136,18 @@ func (po *Port) assignValues(columns []string, values []any) error { } else if value.Valid { po.UpdatedAt = value.Time } + case port.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + po.CreatedBy = value.String + } + case port.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + po.UpdatedBy = value.String + } case port.FieldNumber: if value, ok := values[i].(*sql.NullInt64); !ok { return fmt.Errorf("unexpected type %T for field number", values[i]) @@ -202,6 +218,12 @@ func (po *Port) String() string { builder.WriteString("updated_at=") builder.WriteString(po.UpdatedAt.Format(time.ANSIC)) builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(po.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(po.UpdatedBy) + builder.WriteString(", ") builder.WriteString("number=") builder.WriteString(fmt.Sprintf("%v", po.Number)) builder.WriteString(", ") diff --git a/internal/ent/generated/port/port.go b/internal/ent/generated/port/port.go index 01c1f3bf0..53953f34c 100644 --- a/internal/ent/generated/port/port.go +++ b/internal/ent/generated/port/port.go @@ -19,6 +19,7 @@ package port import ( "time" + "entgo.io/ent" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "go.infratographer.com/x/gidx" @@ -33,6 +34,10 @@ const ( FieldCreatedAt = "created_at" // FieldUpdatedAt holds the string denoting the updated_at field in the database. FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" // FieldNumber holds the string denoting the number field in the database. FieldNumber = "number" // FieldName holds the string denoting the name field in the database. @@ -64,6 +69,8 @@ var Columns = []string{ FieldID, FieldCreatedAt, FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, FieldNumber, FieldName, FieldLoadBalancerID, @@ -85,7 +92,13 @@ func ValidColumn(column string) bool { return false } +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" var ( + Hooks [1]ent.Hook // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. @@ -118,6 +131,16 @@ func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() } +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + // ByNumber orders the results by the number field. func ByNumber(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldNumber, opts...).ToFunc() diff --git a/internal/ent/generated/port/where.go b/internal/ent/generated/port/where.go index d9e0cd3d0..c8ba45606 100644 --- a/internal/ent/generated/port/where.go +++ b/internal/ent/generated/port/where.go @@ -80,6 +80,16 @@ func UpdatedAt(v time.Time) predicate.Port { return predicate.Port(sql.FieldEQ(FieldUpdatedAt, v)) } +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Port { + return predicate.Port(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Port { + return predicate.Port(sql.FieldEQ(FieldUpdatedBy, v)) +} + // Number applies equality check predicate on the "number" field. It's identical to NumberEQ. func Number(v int) predicate.Port { return predicate.Port(sql.FieldEQ(FieldNumber, v)) @@ -175,6 +185,156 @@ func UpdatedAtLTE(v time.Time) predicate.Port { return predicate.Port(sql.FieldLTE(FieldUpdatedAt, v)) } +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Port { + return predicate.Port(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Port { + return predicate.Port(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Port { + return predicate.Port(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Port { + return predicate.Port(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Port { + return predicate.Port(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Port { + return predicate.Port(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Port { + return predicate.Port(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Port { + return predicate.Port(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Port { + return predicate.Port(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Port { + return predicate.Port(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Port { + return predicate.Port(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Port { + return predicate.Port(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Port { + return predicate.Port(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Port { + return predicate.Port(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Port { + return predicate.Port(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Port { + return predicate.Port(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Port { + return predicate.Port(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Port { + return predicate.Port(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Port { + return predicate.Port(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Port { + return predicate.Port(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Port { + return predicate.Port(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Port { + return predicate.Port(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Port { + return predicate.Port(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Port { + return predicate.Port(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Port { + return predicate.Port(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Port { + return predicate.Port(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Port { + return predicate.Port(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Port { + return predicate.Port(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Port { + return predicate.Port(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Port { + return predicate.Port(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + // NumberEQ applies the EQ predicate on the "number" field. func NumberEQ(v int) predicate.Port { return predicate.Port(sql.FieldEQ(FieldNumber, v)) diff --git a/internal/ent/generated/port_create.go b/internal/ent/generated/port_create.go index 148089e05..e4b56a0d8 100644 --- a/internal/ent/generated/port_create.go +++ b/internal/ent/generated/port_create.go @@ -65,6 +65,34 @@ func (pc *PortCreate) SetNillableUpdatedAt(t *time.Time) *PortCreate { return pc } +// SetCreatedBy sets the "created_by" field. +func (pc *PortCreate) SetCreatedBy(s string) *PortCreate { + pc.mutation.SetCreatedBy(s) + return pc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (pc *PortCreate) SetNillableCreatedBy(s *string) *PortCreate { + if s != nil { + pc.SetCreatedBy(*s) + } + return pc +} + +// SetUpdatedBy sets the "updated_by" field. +func (pc *PortCreate) SetUpdatedBy(s string) *PortCreate { + pc.mutation.SetUpdatedBy(s) + return pc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (pc *PortCreate) SetNillableUpdatedBy(s *string) *PortCreate { + if s != nil { + pc.SetUpdatedBy(*s) + } + return pc +} + // SetNumber sets the "number" field. func (pc *PortCreate) SetNumber(i int) *PortCreate { pc.mutation.SetNumber(i) @@ -124,7 +152,9 @@ func (pc *PortCreate) Mutation() *PortMutation { // Save creates the Port in the database. func (pc *PortCreate) Save(ctx context.Context) (*Port, error) { - pc.defaults() + if err := pc.defaults(); err != nil { + return nil, err + } return withHooks(ctx, pc.sqlSave, pc.mutation, pc.hooks) } @@ -151,19 +181,29 @@ func (pc *PortCreate) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (pc *PortCreate) defaults() { +func (pc *PortCreate) defaults() error { if _, ok := pc.mutation.CreatedAt(); !ok { + if port.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized port.DefaultCreatedAt (forgotten import generated/runtime?)") + } v := port.DefaultCreatedAt() pc.mutation.SetCreatedAt(v) } if _, ok := pc.mutation.UpdatedAt(); !ok { + if port.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized port.DefaultUpdatedAt (forgotten import generated/runtime?)") + } v := port.DefaultUpdatedAt() pc.mutation.SetUpdatedAt(v) } if _, ok := pc.mutation.ID(); !ok { + if port.DefaultID == nil { + return fmt.Errorf("generated: uninitialized port.DefaultID (forgotten import generated/runtime?)") + } v := port.DefaultID() pc.mutation.SetID(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -239,6 +279,14 @@ func (pc *PortCreate) createSpec() (*Port, *sqlgraph.CreateSpec) { _spec.SetField(port.FieldUpdatedAt, field.TypeTime, value) _node.UpdatedAt = value } + if value, ok := pc.mutation.CreatedBy(); ok { + _spec.SetField(port.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := pc.mutation.UpdatedBy(); ok { + _spec.SetField(port.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } if value, ok := pc.mutation.Number(); ok { _spec.SetField(port.FieldNumber, field.TypeInt, value) _node.Number = value diff --git a/internal/ent/generated/port_update.go b/internal/ent/generated/port_update.go index 2c1de4074..2367ffcab 100644 --- a/internal/ent/generated/port_update.go +++ b/internal/ent/generated/port_update.go @@ -43,6 +43,26 @@ func (pu *PortUpdate) Where(ps ...predicate.Port) *PortUpdate { return pu } +// SetUpdatedBy sets the "updated_by" field. +func (pu *PortUpdate) SetUpdatedBy(s string) *PortUpdate { + pu.mutation.SetUpdatedBy(s) + return pu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (pu *PortUpdate) SetNillableUpdatedBy(s *string) *PortUpdate { + if s != nil { + pu.SetUpdatedBy(*s) + } + return pu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (pu *PortUpdate) ClearUpdatedBy() *PortUpdate { + pu.mutation.ClearUpdatedBy() + return pu +} + // SetNumber sets the "number" field. func (pu *PortUpdate) SetNumber(i int) *PortUpdate { pu.mutation.ResetNumber() @@ -105,7 +125,9 @@ func (pu *PortUpdate) RemovePools(p ...*Pool) *PortUpdate { // Save executes the query and returns the number of nodes affected by the update operation. func (pu *PortUpdate) Save(ctx context.Context) (int, error) { - pu.defaults() + if err := pu.defaults(); err != nil { + return 0, err + } return withHooks(ctx, pu.sqlSave, pu.mutation, pu.hooks) } @@ -132,11 +154,15 @@ func (pu *PortUpdate) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (pu *PortUpdate) defaults() { +func (pu *PortUpdate) defaults() error { if _, ok := pu.mutation.UpdatedAt(); !ok { + if port.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized port.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } v := port.UpdateDefaultUpdatedAt() pu.mutation.SetUpdatedAt(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -167,6 +193,15 @@ func (pu *PortUpdate) sqlSave(ctx context.Context) (n int, err error) { if value, ok := pu.mutation.UpdatedAt(); ok { _spec.SetField(port.FieldUpdatedAt, field.TypeTime, value) } + if pu.mutation.CreatedByCleared() { + _spec.ClearField(port.FieldCreatedBy, field.TypeString) + } + if value, ok := pu.mutation.UpdatedBy(); ok { + _spec.SetField(port.FieldUpdatedBy, field.TypeString, value) + } + if pu.mutation.UpdatedByCleared() { + _spec.ClearField(port.FieldUpdatedBy, field.TypeString) + } if value, ok := pu.mutation.Number(); ok { _spec.SetField(port.FieldNumber, field.TypeInt, value) } @@ -241,6 +276,26 @@ type PortUpdateOne struct { mutation *PortMutation } +// SetUpdatedBy sets the "updated_by" field. +func (puo *PortUpdateOne) SetUpdatedBy(s string) *PortUpdateOne { + puo.mutation.SetUpdatedBy(s) + return puo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (puo *PortUpdateOne) SetNillableUpdatedBy(s *string) *PortUpdateOne { + if s != nil { + puo.SetUpdatedBy(*s) + } + return puo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (puo *PortUpdateOne) ClearUpdatedBy() *PortUpdateOne { + puo.mutation.ClearUpdatedBy() + return puo +} + // SetNumber sets the "number" field. func (puo *PortUpdateOne) SetNumber(i int) *PortUpdateOne { puo.mutation.ResetNumber() @@ -316,7 +371,9 @@ func (puo *PortUpdateOne) Select(field string, fields ...string) *PortUpdateOne // Save executes the query and returns the updated Port entity. func (puo *PortUpdateOne) Save(ctx context.Context) (*Port, error) { - puo.defaults() + if err := puo.defaults(); err != nil { + return nil, err + } return withHooks(ctx, puo.sqlSave, puo.mutation, puo.hooks) } @@ -343,11 +400,15 @@ func (puo *PortUpdateOne) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (puo *PortUpdateOne) defaults() { +func (puo *PortUpdateOne) defaults() error { if _, ok := puo.mutation.UpdatedAt(); !ok { + if port.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized port.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } v := port.UpdateDefaultUpdatedAt() puo.mutation.SetUpdatedAt(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -395,6 +456,15 @@ func (puo *PortUpdateOne) sqlSave(ctx context.Context) (_node *Port, err error) if value, ok := puo.mutation.UpdatedAt(); ok { _spec.SetField(port.FieldUpdatedAt, field.TypeTime, value) } + if puo.mutation.CreatedByCleared() { + _spec.ClearField(port.FieldCreatedBy, field.TypeString) + } + if value, ok := puo.mutation.UpdatedBy(); ok { + _spec.SetField(port.FieldUpdatedBy, field.TypeString, value) + } + if puo.mutation.UpdatedByCleared() { + _spec.ClearField(port.FieldUpdatedBy, field.TypeString) + } if value, ok := puo.mutation.Number(); ok { _spec.SetField(port.FieldNumber, field.TypeInt, value) } diff --git a/internal/ent/generated/provider.go b/internal/ent/generated/provider.go index 28ed622f0..7e9582099 100644 --- a/internal/ent/generated/provider.go +++ b/internal/ent/generated/provider.go @@ -37,6 +37,10 @@ type Provider struct { CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` // The name of the load balancer provider. Name string `json:"name,omitempty"` // The ID for the owner for this load balancer. @@ -76,7 +80,7 @@ func (*Provider) scanValues(columns []string) ([]any, error) { switch columns[i] { case provider.FieldID, provider.FieldOwnerID: values[i] = new(gidx.PrefixedID) - case provider.FieldName: + case provider.FieldCreatedBy, provider.FieldUpdatedBy, provider.FieldName: values[i] = new(sql.NullString) case provider.FieldCreatedAt, provider.FieldUpdatedAt: values[i] = new(sql.NullTime) @@ -113,6 +117,18 @@ func (pr *Provider) assignValues(columns []string, values []any) error { } else if value.Valid { pr.UpdatedAt = value.Time } + case provider.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + pr.CreatedBy = value.String + } + case provider.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + pr.UpdatedBy = value.String + } case provider.FieldName: if value, ok := values[i].(*sql.NullString); !ok { return fmt.Errorf("unexpected type %T for field name", values[i]) @@ -172,6 +188,12 @@ func (pr *Provider) String() string { builder.WriteString("updated_at=") builder.WriteString(pr.UpdatedAt.Format(time.ANSIC)) builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(pr.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(pr.UpdatedBy) + builder.WriteString(", ") builder.WriteString("name=") builder.WriteString(pr.Name) builder.WriteString(", ") diff --git a/internal/ent/generated/provider/provider.go b/internal/ent/generated/provider/provider.go index 22ffdf7c9..554cf6d09 100644 --- a/internal/ent/generated/provider/provider.go +++ b/internal/ent/generated/provider/provider.go @@ -19,6 +19,7 @@ package provider import ( "time" + "entgo.io/ent" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "go.infratographer.com/x/gidx" @@ -33,6 +34,10 @@ const ( FieldCreatedAt = "created_at" // FieldUpdatedAt holds the string denoting the updated_at field in the database. FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" // FieldName holds the string denoting the name field in the database. FieldName = "name" // FieldOwnerID holds the string denoting the owner_id field in the database. @@ -55,6 +60,8 @@ var Columns = []string{ FieldID, FieldCreatedAt, FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, FieldName, FieldOwnerID, } @@ -69,7 +76,13 @@ func ValidColumn(column string) bool { return false } +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" var ( + Hooks [1]ent.Hook // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. @@ -102,6 +115,16 @@ func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() } +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + // ByName orders the results by the name field. func ByName(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldName, opts...).ToFunc() diff --git a/internal/ent/generated/provider/where.go b/internal/ent/generated/provider/where.go index f3daf70ea..66d0e448b 100644 --- a/internal/ent/generated/provider/where.go +++ b/internal/ent/generated/provider/where.go @@ -80,6 +80,16 @@ func UpdatedAt(v time.Time) predicate.Provider { return predicate.Provider(sql.FieldEQ(FieldUpdatedAt, v)) } +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Provider { + return predicate.Provider(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Provider { + return predicate.Provider(sql.FieldEQ(FieldUpdatedBy, v)) +} + // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Provider { return predicate.Provider(sql.FieldEQ(FieldName, v)) @@ -170,6 +180,156 @@ func UpdatedAtLTE(v time.Time) predicate.Provider { return predicate.Provider(sql.FieldLTE(FieldUpdatedAt, v)) } +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Provider { + return predicate.Provider(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Provider { + return predicate.Provider(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Provider { + return predicate.Provider(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Provider { + return predicate.Provider(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Provider { + return predicate.Provider(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Provider { + return predicate.Provider(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Provider { + return predicate.Provider(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Provider { + return predicate.Provider(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Provider { + return predicate.Provider(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Provider { + return predicate.Provider(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Provider { + return predicate.Provider(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Provider { + return predicate.Provider(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Provider { + return predicate.Provider(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Provider { + return predicate.Provider(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Provider { + return predicate.Provider(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Provider { + return predicate.Provider(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Provider { + return predicate.Provider(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Provider { + return predicate.Provider(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Provider { + return predicate.Provider(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Provider { + return predicate.Provider(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Provider { + return predicate.Provider(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Provider { + return predicate.Provider(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Provider { + return predicate.Provider(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Provider { + return predicate.Provider(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Provider { + return predicate.Provider(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Provider { + return predicate.Provider(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Provider { + return predicate.Provider(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Provider { + return predicate.Provider(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Provider { + return predicate.Provider(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Provider { + return predicate.Provider(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Provider { return predicate.Provider(sql.FieldEQ(FieldName, v)) diff --git a/internal/ent/generated/provider_create.go b/internal/ent/generated/provider_create.go index f37496f68..0f84327d4 100644 --- a/internal/ent/generated/provider_create.go +++ b/internal/ent/generated/provider_create.go @@ -64,6 +64,34 @@ func (pc *ProviderCreate) SetNillableUpdatedAt(t *time.Time) *ProviderCreate { return pc } +// SetCreatedBy sets the "created_by" field. +func (pc *ProviderCreate) SetCreatedBy(s string) *ProviderCreate { + pc.mutation.SetCreatedBy(s) + return pc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (pc *ProviderCreate) SetNillableCreatedBy(s *string) *ProviderCreate { + if s != nil { + pc.SetCreatedBy(*s) + } + return pc +} + +// SetUpdatedBy sets the "updated_by" field. +func (pc *ProviderCreate) SetUpdatedBy(s string) *ProviderCreate { + pc.mutation.SetUpdatedBy(s) + return pc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (pc *ProviderCreate) SetNillableUpdatedBy(s *string) *ProviderCreate { + if s != nil { + pc.SetUpdatedBy(*s) + } + return pc +} + // SetName sets the "name" field. func (pc *ProviderCreate) SetName(s string) *ProviderCreate { pc.mutation.SetName(s) @@ -112,7 +140,9 @@ func (pc *ProviderCreate) Mutation() *ProviderMutation { // Save creates the Provider in the database. func (pc *ProviderCreate) Save(ctx context.Context) (*Provider, error) { - pc.defaults() + if err := pc.defaults(); err != nil { + return nil, err + } return withHooks(ctx, pc.sqlSave, pc.mutation, pc.hooks) } @@ -139,19 +169,29 @@ func (pc *ProviderCreate) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (pc *ProviderCreate) defaults() { +func (pc *ProviderCreate) defaults() error { if _, ok := pc.mutation.CreatedAt(); !ok { + if provider.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized provider.DefaultCreatedAt (forgotten import generated/runtime?)") + } v := provider.DefaultCreatedAt() pc.mutation.SetCreatedAt(v) } if _, ok := pc.mutation.UpdatedAt(); !ok { + if provider.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized provider.DefaultUpdatedAt (forgotten import generated/runtime?)") + } v := provider.DefaultUpdatedAt() pc.mutation.SetUpdatedAt(v) } if _, ok := pc.mutation.ID(); !ok { + if provider.DefaultID == nil { + return fmt.Errorf("generated: uninitialized provider.DefaultID (forgotten import generated/runtime?)") + } v := provider.DefaultID() pc.mutation.SetID(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -221,6 +261,14 @@ func (pc *ProviderCreate) createSpec() (*Provider, *sqlgraph.CreateSpec) { _spec.SetField(provider.FieldUpdatedAt, field.TypeTime, value) _node.UpdatedAt = value } + if value, ok := pc.mutation.CreatedBy(); ok { + _spec.SetField(provider.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := pc.mutation.UpdatedBy(); ok { + _spec.SetField(provider.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } if value, ok := pc.mutation.Name(); ok { _spec.SetField(provider.FieldName, field.TypeString, value) _node.Name = value diff --git a/internal/ent/generated/provider_update.go b/internal/ent/generated/provider_update.go index 6db34a3a3..ad81b6cfe 100644 --- a/internal/ent/generated/provider_update.go +++ b/internal/ent/generated/provider_update.go @@ -43,6 +43,26 @@ func (pu *ProviderUpdate) Where(ps ...predicate.Provider) *ProviderUpdate { return pu } +// SetUpdatedBy sets the "updated_by" field. +func (pu *ProviderUpdate) SetUpdatedBy(s string) *ProviderUpdate { + pu.mutation.SetUpdatedBy(s) + return pu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (pu *ProviderUpdate) SetNillableUpdatedBy(s *string) *ProviderUpdate { + if s != nil { + pu.SetUpdatedBy(*s) + } + return pu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (pu *ProviderUpdate) ClearUpdatedBy() *ProviderUpdate { + pu.mutation.ClearUpdatedBy() + return pu +} + // SetName sets the "name" field. func (pu *ProviderUpdate) SetName(s string) *ProviderUpdate { pu.mutation.SetName(s) @@ -92,7 +112,9 @@ func (pu *ProviderUpdate) RemoveLoadBalancers(l ...*LoadBalancer) *ProviderUpdat // Save executes the query and returns the number of nodes affected by the update operation. func (pu *ProviderUpdate) Save(ctx context.Context) (int, error) { - pu.defaults() + if err := pu.defaults(); err != nil { + return 0, err + } return withHooks(ctx, pu.sqlSave, pu.mutation, pu.hooks) } @@ -119,11 +141,15 @@ func (pu *ProviderUpdate) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (pu *ProviderUpdate) defaults() { +func (pu *ProviderUpdate) defaults() error { if _, ok := pu.mutation.UpdatedAt(); !ok { + if provider.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized provider.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } v := provider.UpdateDefaultUpdatedAt() pu.mutation.SetUpdatedAt(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -151,6 +177,15 @@ func (pu *ProviderUpdate) sqlSave(ctx context.Context) (n int, err error) { if value, ok := pu.mutation.UpdatedAt(); ok { _spec.SetField(provider.FieldUpdatedAt, field.TypeTime, value) } + if pu.mutation.CreatedByCleared() { + _spec.ClearField(provider.FieldCreatedBy, field.TypeString) + } + if value, ok := pu.mutation.UpdatedBy(); ok { + _spec.SetField(provider.FieldUpdatedBy, field.TypeString, value) + } + if pu.mutation.UpdatedByCleared() { + _spec.ClearField(provider.FieldUpdatedBy, field.TypeString) + } if value, ok := pu.mutation.Name(); ok { _spec.SetField(provider.FieldName, field.TypeString, value) } @@ -219,6 +254,26 @@ type ProviderUpdateOne struct { mutation *ProviderMutation } +// SetUpdatedBy sets the "updated_by" field. +func (puo *ProviderUpdateOne) SetUpdatedBy(s string) *ProviderUpdateOne { + puo.mutation.SetUpdatedBy(s) + return puo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (puo *ProviderUpdateOne) SetNillableUpdatedBy(s *string) *ProviderUpdateOne { + if s != nil { + puo.SetUpdatedBy(*s) + } + return puo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (puo *ProviderUpdateOne) ClearUpdatedBy() *ProviderUpdateOne { + puo.mutation.ClearUpdatedBy() + return puo +} + // SetName sets the "name" field. func (puo *ProviderUpdateOne) SetName(s string) *ProviderUpdateOne { puo.mutation.SetName(s) @@ -281,7 +336,9 @@ func (puo *ProviderUpdateOne) Select(field string, fields ...string) *ProviderUp // Save executes the query and returns the updated Provider entity. func (puo *ProviderUpdateOne) Save(ctx context.Context) (*Provider, error) { - puo.defaults() + if err := puo.defaults(); err != nil { + return nil, err + } return withHooks(ctx, puo.sqlSave, puo.mutation, puo.hooks) } @@ -308,11 +365,15 @@ func (puo *ProviderUpdateOne) ExecX(ctx context.Context) { } // defaults sets the default values of the builder before save. -func (puo *ProviderUpdateOne) defaults() { +func (puo *ProviderUpdateOne) defaults() error { if _, ok := puo.mutation.UpdatedAt(); !ok { + if provider.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized provider.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } v := provider.UpdateDefaultUpdatedAt() puo.mutation.SetUpdatedAt(v) } + return nil } // check runs all checks and user-defined validators on the builder. @@ -357,6 +418,15 @@ func (puo *ProviderUpdateOne) sqlSave(ctx context.Context) (_node *Provider, err if value, ok := puo.mutation.UpdatedAt(); ok { _spec.SetField(provider.FieldUpdatedAt, field.TypeTime, value) } + if puo.mutation.CreatedByCleared() { + _spec.ClearField(provider.FieldCreatedBy, field.TypeString) + } + if value, ok := puo.mutation.UpdatedBy(); ok { + _spec.SetField(provider.FieldUpdatedBy, field.TypeString, value) + } + if puo.mutation.UpdatedByCleared() { + _spec.ClearField(provider.FieldUpdatedBy, field.TypeString) + } if value, ok := puo.mutation.Name(); ok { _spec.SetField(provider.FieldName, field.TypeString, value) } diff --git a/internal/ent/generated/runtime.go b/internal/ent/generated/runtime.go index 40b521c21..b710d4761 100644 --- a/internal/ent/generated/runtime.go +++ b/internal/ent/generated/runtime.go @@ -16,222 +16,4 @@ package generated -import ( - "time" - - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/origin" - "go.infratographer.com/load-balancer-api/internal/ent/generated/pool" - "go.infratographer.com/load-balancer-api/internal/ent/generated/port" - "go.infratographer.com/load-balancer-api/internal/ent/generated/provider" - "go.infratographer.com/load-balancer-api/internal/ent/schema" - "go.infratographer.com/x/gidx" -) - -// The init function reads all schema descriptors with runtime code -// (default values, validators, hooks and policies) and stitches it -// to their package variables. -func init() { - loadbalancerMixin := schema.LoadBalancer{}.Mixin() - loadbalancerMixinFields0 := loadbalancerMixin[0].Fields() - _ = loadbalancerMixinFields0 - loadbalancerFields := schema.LoadBalancer{}.Fields() - _ = loadbalancerFields - // loadbalancerDescCreatedAt is the schema descriptor for created_at field. - loadbalancerDescCreatedAt := loadbalancerMixinFields0[0].Descriptor() - // loadbalancer.DefaultCreatedAt holds the default value on creation for the created_at field. - loadbalancer.DefaultCreatedAt = loadbalancerDescCreatedAt.Default.(func() time.Time) - // loadbalancerDescUpdatedAt is the schema descriptor for updated_at field. - loadbalancerDescUpdatedAt := loadbalancerMixinFields0[1].Descriptor() - // loadbalancer.DefaultUpdatedAt holds the default value on creation for the updated_at field. - loadbalancer.DefaultUpdatedAt = loadbalancerDescUpdatedAt.Default.(func() time.Time) - // loadbalancer.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. - loadbalancer.UpdateDefaultUpdatedAt = loadbalancerDescUpdatedAt.UpdateDefault.(func() time.Time) - // loadbalancerDescName is the schema descriptor for name field. - loadbalancerDescName := loadbalancerFields[1].Descriptor() - // loadbalancer.NameValidator is a validator for the "name" field. It is called by the builders before save. - loadbalancer.NameValidator = loadbalancerDescName.Validators[0].(func(string) error) - // loadbalancerDescOwnerID is the schema descriptor for owner_id field. - loadbalancerDescOwnerID := loadbalancerFields[2].Descriptor() - // loadbalancer.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. - loadbalancer.OwnerIDValidator = loadbalancerDescOwnerID.Validators[0].(func(string) error) - // loadbalancerDescLocationID is the schema descriptor for location_id field. - loadbalancerDescLocationID := loadbalancerFields[3].Descriptor() - // loadbalancer.LocationIDValidator is a validator for the "location_id" field. It is called by the builders before save. - loadbalancer.LocationIDValidator = loadbalancerDescLocationID.Validators[0].(func(string) error) - // loadbalancerDescProviderID is the schema descriptor for provider_id field. - loadbalancerDescProviderID := loadbalancerFields[4].Descriptor() - // loadbalancer.ProviderIDValidator is a validator for the "provider_id" field. It is called by the builders before save. - loadbalancer.ProviderIDValidator = loadbalancerDescProviderID.Validators[0].(func(string) error) - // loadbalancerDescID is the schema descriptor for id field. - loadbalancerDescID := loadbalancerFields[0].Descriptor() - // loadbalancer.DefaultID holds the default value on creation for the id field. - loadbalancer.DefaultID = loadbalancerDescID.Default.(func() gidx.PrefixedID) - originMixin := schema.Origin{}.Mixin() - originMixinFields0 := originMixin[0].Fields() - _ = originMixinFields0 - originFields := schema.Origin{}.Fields() - _ = originFields - // originDescCreatedAt is the schema descriptor for created_at field. - originDescCreatedAt := originMixinFields0[0].Descriptor() - // origin.DefaultCreatedAt holds the default value on creation for the created_at field. - origin.DefaultCreatedAt = originDescCreatedAt.Default.(func() time.Time) - // originDescUpdatedAt is the schema descriptor for updated_at field. - originDescUpdatedAt := originMixinFields0[1].Descriptor() - // origin.DefaultUpdatedAt holds the default value on creation for the updated_at field. - origin.DefaultUpdatedAt = originDescUpdatedAt.Default.(func() time.Time) - // origin.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. - origin.UpdateDefaultUpdatedAt = originDescUpdatedAt.UpdateDefault.(func() time.Time) - // originDescName is the schema descriptor for name field. - originDescName := originFields[1].Descriptor() - // origin.NameValidator is a validator for the "name" field. It is called by the builders before save. - origin.NameValidator = originDescName.Validators[0].(func(string) error) - // originDescWeight is the schema descriptor for weight field. - originDescWeight := originFields[2].Descriptor() - // origin.DefaultWeight holds the default value on creation for the weight field. - origin.DefaultWeight = originDescWeight.Default.(int32) - // originDescTarget is the schema descriptor for target field. - originDescTarget := originFields[3].Descriptor() - // origin.TargetValidator is a validator for the "target" field. It is called by the builders before save. - origin.TargetValidator = func() func(string) error { - validators := originDescTarget.Validators - fns := [...]func(string) error{ - validators[0].(func(string) error), - validators[1].(func(string) error), - } - return func(target string) error { - for _, fn := range fns { - if err := fn(target); err != nil { - return err - } - } - return nil - } - }() - // originDescPortNumber is the schema descriptor for port_number field. - originDescPortNumber := originFields[4].Descriptor() - // origin.PortNumberValidator is a validator for the "port_number" field. It is called by the builders before save. - origin.PortNumberValidator = func() func(int) error { - validators := originDescPortNumber.Validators - fns := [...]func(int) error{ - validators[0].(func(int) error), - validators[1].(func(int) error), - } - return func(port_number int) error { - for _, fn := range fns { - if err := fn(port_number); err != nil { - return err - } - } - return nil - } - }() - // originDescActive is the schema descriptor for active field. - originDescActive := originFields[5].Descriptor() - // origin.DefaultActive holds the default value on creation for the active field. - origin.DefaultActive = originDescActive.Default.(bool) - // originDescPoolID is the schema descriptor for pool_id field. - originDescPoolID := originFields[6].Descriptor() - // origin.PoolIDValidator is a validator for the "pool_id" field. It is called by the builders before save. - origin.PoolIDValidator = originDescPoolID.Validators[0].(func(string) error) - // originDescID is the schema descriptor for id field. - originDescID := originFields[0].Descriptor() - // origin.DefaultID holds the default value on creation for the id field. - origin.DefaultID = originDescID.Default.(func() gidx.PrefixedID) - poolMixin := schema.Pool{}.Mixin() - poolMixinFields0 := poolMixin[0].Fields() - _ = poolMixinFields0 - poolFields := schema.Pool{}.Fields() - _ = poolFields - // poolDescCreatedAt is the schema descriptor for created_at field. - poolDescCreatedAt := poolMixinFields0[0].Descriptor() - // pool.DefaultCreatedAt holds the default value on creation for the created_at field. - pool.DefaultCreatedAt = poolDescCreatedAt.Default.(func() time.Time) - // poolDescUpdatedAt is the schema descriptor for updated_at field. - poolDescUpdatedAt := poolMixinFields0[1].Descriptor() - // pool.DefaultUpdatedAt holds the default value on creation for the updated_at field. - pool.DefaultUpdatedAt = poolDescUpdatedAt.Default.(func() time.Time) - // pool.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. - pool.UpdateDefaultUpdatedAt = poolDescUpdatedAt.UpdateDefault.(func() time.Time) - // poolDescName is the schema descriptor for name field. - poolDescName := poolFields[1].Descriptor() - // pool.NameValidator is a validator for the "name" field. It is called by the builders before save. - pool.NameValidator = poolDescName.Validators[0].(func(string) error) - // poolDescOwnerID is the schema descriptor for owner_id field. - poolDescOwnerID := poolFields[3].Descriptor() - // pool.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. - pool.OwnerIDValidator = poolDescOwnerID.Validators[0].(func(string) error) - // poolDescID is the schema descriptor for id field. - poolDescID := poolFields[0].Descriptor() - // pool.DefaultID holds the default value on creation for the id field. - pool.DefaultID = poolDescID.Default.(func() gidx.PrefixedID) - portMixin := schema.Port{}.Mixin() - portMixinFields0 := portMixin[0].Fields() - _ = portMixinFields0 - portFields := schema.Port{}.Fields() - _ = portFields - // portDescCreatedAt is the schema descriptor for created_at field. - portDescCreatedAt := portMixinFields0[0].Descriptor() - // port.DefaultCreatedAt holds the default value on creation for the created_at field. - port.DefaultCreatedAt = portDescCreatedAt.Default.(func() time.Time) - // portDescUpdatedAt is the schema descriptor for updated_at field. - portDescUpdatedAt := portMixinFields0[1].Descriptor() - // port.DefaultUpdatedAt holds the default value on creation for the updated_at field. - port.DefaultUpdatedAt = portDescUpdatedAt.Default.(func() time.Time) - // port.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. - port.UpdateDefaultUpdatedAt = portDescUpdatedAt.UpdateDefault.(func() time.Time) - // portDescNumber is the schema descriptor for number field. - portDescNumber := portFields[1].Descriptor() - // port.NumberValidator is a validator for the "number" field. It is called by the builders before save. - port.NumberValidator = func() func(int) error { - validators := portDescNumber.Validators - fns := [...]func(int) error{ - validators[0].(func(int) error), - validators[1].(func(int) error), - validators[2].(func(int) error), - } - return func(number int) error { - for _, fn := range fns { - if err := fn(number); err != nil { - return err - } - } - return nil - } - }() - // portDescLoadBalancerID is the schema descriptor for load_balancer_id field. - portDescLoadBalancerID := portFields[3].Descriptor() - // port.LoadBalancerIDValidator is a validator for the "load_balancer_id" field. It is called by the builders before save. - port.LoadBalancerIDValidator = portDescLoadBalancerID.Validators[0].(func(string) error) - // portDescID is the schema descriptor for id field. - portDescID := portFields[0].Descriptor() - // port.DefaultID holds the default value on creation for the id field. - port.DefaultID = portDescID.Default.(func() gidx.PrefixedID) - providerMixin := schema.Provider{}.Mixin() - providerMixinFields0 := providerMixin[0].Fields() - _ = providerMixinFields0 - providerFields := schema.Provider{}.Fields() - _ = providerFields - // providerDescCreatedAt is the schema descriptor for created_at field. - providerDescCreatedAt := providerMixinFields0[0].Descriptor() - // provider.DefaultCreatedAt holds the default value on creation for the created_at field. - provider.DefaultCreatedAt = providerDescCreatedAt.Default.(func() time.Time) - // providerDescUpdatedAt is the schema descriptor for updated_at field. - providerDescUpdatedAt := providerMixinFields0[1].Descriptor() - // provider.DefaultUpdatedAt holds the default value on creation for the updated_at field. - provider.DefaultUpdatedAt = providerDescUpdatedAt.Default.(func() time.Time) - // provider.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. - provider.UpdateDefaultUpdatedAt = providerDescUpdatedAt.UpdateDefault.(func() time.Time) - // providerDescName is the schema descriptor for name field. - providerDescName := providerFields[1].Descriptor() - // provider.NameValidator is a validator for the "name" field. It is called by the builders before save. - provider.NameValidator = providerDescName.Validators[0].(func(string) error) - // providerDescOwnerID is the schema descriptor for owner_id field. - providerDescOwnerID := providerFields[2].Descriptor() - // provider.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. - provider.OwnerIDValidator = providerDescOwnerID.Validators[0].(func(string) error) - // providerDescID is the schema descriptor for id field. - providerDescID := providerFields[0].Descriptor() - // provider.DefaultID holds the default value on creation for the id field. - provider.DefaultID = providerDescID.Default.(func() gidx.PrefixedID) -} +// The schema-stitching logic is generated in go.infratographer.com/load-balancer-api/internal/ent/generated/runtime/runtime.go diff --git a/internal/ent/generated/runtime/runtime.go b/internal/ent/generated/runtime/runtime.go index ca071b138..0820916c8 100644 --- a/internal/ent/generated/runtime/runtime.go +++ b/internal/ent/generated/runtime/runtime.go @@ -16,7 +16,235 @@ package runtime -// The schema-stitching logic is generated in go.infratographer.com/load-balancer-api/internal/ent/generated/runtime.go +import ( + "time" + + "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" + "go.infratographer.com/load-balancer-api/internal/ent/generated/origin" + "go.infratographer.com/load-balancer-api/internal/ent/generated/pool" + "go.infratographer.com/load-balancer-api/internal/ent/generated/port" + "go.infratographer.com/load-balancer-api/internal/ent/generated/provider" + "go.infratographer.com/load-balancer-api/internal/ent/schema" + "go.infratographer.com/x/gidx" +) + +// The init function reads all schema descriptors with runtime code +// (default values, validators, hooks and policies) and stitches it +// to their package variables. +func init() { + loadbalancerMixin := schema.LoadBalancer{}.Mixin() + loadbalancerMixinHooks1 := loadbalancerMixin[1].Hooks() + loadbalancer.Hooks[0] = loadbalancerMixinHooks1[0] + loadbalancerMixinFields0 := loadbalancerMixin[0].Fields() + _ = loadbalancerMixinFields0 + loadbalancerFields := schema.LoadBalancer{}.Fields() + _ = loadbalancerFields + // loadbalancerDescCreatedAt is the schema descriptor for created_at field. + loadbalancerDescCreatedAt := loadbalancerMixinFields0[0].Descriptor() + // loadbalancer.DefaultCreatedAt holds the default value on creation for the created_at field. + loadbalancer.DefaultCreatedAt = loadbalancerDescCreatedAt.Default.(func() time.Time) + // loadbalancerDescUpdatedAt is the schema descriptor for updated_at field. + loadbalancerDescUpdatedAt := loadbalancerMixinFields0[1].Descriptor() + // loadbalancer.DefaultUpdatedAt holds the default value on creation for the updated_at field. + loadbalancer.DefaultUpdatedAt = loadbalancerDescUpdatedAt.Default.(func() time.Time) + // loadbalancer.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + loadbalancer.UpdateDefaultUpdatedAt = loadbalancerDescUpdatedAt.UpdateDefault.(func() time.Time) + // loadbalancerDescName is the schema descriptor for name field. + loadbalancerDescName := loadbalancerFields[1].Descriptor() + // loadbalancer.NameValidator is a validator for the "name" field. It is called by the builders before save. + loadbalancer.NameValidator = loadbalancerDescName.Validators[0].(func(string) error) + // loadbalancerDescOwnerID is the schema descriptor for owner_id field. + loadbalancerDescOwnerID := loadbalancerFields[2].Descriptor() + // loadbalancer.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + loadbalancer.OwnerIDValidator = loadbalancerDescOwnerID.Validators[0].(func(string) error) + // loadbalancerDescLocationID is the schema descriptor for location_id field. + loadbalancerDescLocationID := loadbalancerFields[3].Descriptor() + // loadbalancer.LocationIDValidator is a validator for the "location_id" field. It is called by the builders before save. + loadbalancer.LocationIDValidator = loadbalancerDescLocationID.Validators[0].(func(string) error) + // loadbalancerDescProviderID is the schema descriptor for provider_id field. + loadbalancerDescProviderID := loadbalancerFields[4].Descriptor() + // loadbalancer.ProviderIDValidator is a validator for the "provider_id" field. It is called by the builders before save. + loadbalancer.ProviderIDValidator = loadbalancerDescProviderID.Validators[0].(func(string) error) + // loadbalancerDescID is the schema descriptor for id field. + loadbalancerDescID := loadbalancerFields[0].Descriptor() + // loadbalancer.DefaultID holds the default value on creation for the id field. + loadbalancer.DefaultID = loadbalancerDescID.Default.(func() gidx.PrefixedID) + originMixin := schema.Origin{}.Mixin() + originMixinHooks1 := originMixin[1].Hooks() + origin.Hooks[0] = originMixinHooks1[0] + originMixinFields0 := originMixin[0].Fields() + _ = originMixinFields0 + originFields := schema.Origin{}.Fields() + _ = originFields + // originDescCreatedAt is the schema descriptor for created_at field. + originDescCreatedAt := originMixinFields0[0].Descriptor() + // origin.DefaultCreatedAt holds the default value on creation for the created_at field. + origin.DefaultCreatedAt = originDescCreatedAt.Default.(func() time.Time) + // originDescUpdatedAt is the schema descriptor for updated_at field. + originDescUpdatedAt := originMixinFields0[1].Descriptor() + // origin.DefaultUpdatedAt holds the default value on creation for the updated_at field. + origin.DefaultUpdatedAt = originDescUpdatedAt.Default.(func() time.Time) + // origin.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + origin.UpdateDefaultUpdatedAt = originDescUpdatedAt.UpdateDefault.(func() time.Time) + // originDescName is the schema descriptor for name field. + originDescName := originFields[1].Descriptor() + // origin.NameValidator is a validator for the "name" field. It is called by the builders before save. + origin.NameValidator = originDescName.Validators[0].(func(string) error) + // originDescWeight is the schema descriptor for weight field. + originDescWeight := originFields[2].Descriptor() + // origin.DefaultWeight holds the default value on creation for the weight field. + origin.DefaultWeight = originDescWeight.Default.(int32) + // originDescTarget is the schema descriptor for target field. + originDescTarget := originFields[3].Descriptor() + // origin.TargetValidator is a validator for the "target" field. It is called by the builders before save. + origin.TargetValidator = func() func(string) error { + validators := originDescTarget.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(target string) error { + for _, fn := range fns { + if err := fn(target); err != nil { + return err + } + } + return nil + } + }() + // originDescPortNumber is the schema descriptor for port_number field. + originDescPortNumber := originFields[4].Descriptor() + // origin.PortNumberValidator is a validator for the "port_number" field. It is called by the builders before save. + origin.PortNumberValidator = func() func(int) error { + validators := originDescPortNumber.Validators + fns := [...]func(int) error{ + validators[0].(func(int) error), + validators[1].(func(int) error), + } + return func(port_number int) error { + for _, fn := range fns { + if err := fn(port_number); err != nil { + return err + } + } + return nil + } + }() + // originDescActive is the schema descriptor for active field. + originDescActive := originFields[5].Descriptor() + // origin.DefaultActive holds the default value on creation for the active field. + origin.DefaultActive = originDescActive.Default.(bool) + // originDescPoolID is the schema descriptor for pool_id field. + originDescPoolID := originFields[6].Descriptor() + // origin.PoolIDValidator is a validator for the "pool_id" field. It is called by the builders before save. + origin.PoolIDValidator = originDescPoolID.Validators[0].(func(string) error) + // originDescID is the schema descriptor for id field. + originDescID := originFields[0].Descriptor() + // origin.DefaultID holds the default value on creation for the id field. + origin.DefaultID = originDescID.Default.(func() gidx.PrefixedID) + poolMixin := schema.Pool{}.Mixin() + poolMixinHooks1 := poolMixin[1].Hooks() + pool.Hooks[0] = poolMixinHooks1[0] + poolMixinFields0 := poolMixin[0].Fields() + _ = poolMixinFields0 + poolFields := schema.Pool{}.Fields() + _ = poolFields + // poolDescCreatedAt is the schema descriptor for created_at field. + poolDescCreatedAt := poolMixinFields0[0].Descriptor() + // pool.DefaultCreatedAt holds the default value on creation for the created_at field. + pool.DefaultCreatedAt = poolDescCreatedAt.Default.(func() time.Time) + // poolDescUpdatedAt is the schema descriptor for updated_at field. + poolDescUpdatedAt := poolMixinFields0[1].Descriptor() + // pool.DefaultUpdatedAt holds the default value on creation for the updated_at field. + pool.DefaultUpdatedAt = poolDescUpdatedAt.Default.(func() time.Time) + // pool.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + pool.UpdateDefaultUpdatedAt = poolDescUpdatedAt.UpdateDefault.(func() time.Time) + // poolDescName is the schema descriptor for name field. + poolDescName := poolFields[1].Descriptor() + // pool.NameValidator is a validator for the "name" field. It is called by the builders before save. + pool.NameValidator = poolDescName.Validators[0].(func(string) error) + // poolDescOwnerID is the schema descriptor for owner_id field. + poolDescOwnerID := poolFields[3].Descriptor() + // pool.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + pool.OwnerIDValidator = poolDescOwnerID.Validators[0].(func(string) error) + // poolDescID is the schema descriptor for id field. + poolDescID := poolFields[0].Descriptor() + // pool.DefaultID holds the default value on creation for the id field. + pool.DefaultID = poolDescID.Default.(func() gidx.PrefixedID) + portMixin := schema.Port{}.Mixin() + portMixinHooks1 := portMixin[1].Hooks() + port.Hooks[0] = portMixinHooks1[0] + portMixinFields0 := portMixin[0].Fields() + _ = portMixinFields0 + portFields := schema.Port{}.Fields() + _ = portFields + // portDescCreatedAt is the schema descriptor for created_at field. + portDescCreatedAt := portMixinFields0[0].Descriptor() + // port.DefaultCreatedAt holds the default value on creation for the created_at field. + port.DefaultCreatedAt = portDescCreatedAt.Default.(func() time.Time) + // portDescUpdatedAt is the schema descriptor for updated_at field. + portDescUpdatedAt := portMixinFields0[1].Descriptor() + // port.DefaultUpdatedAt holds the default value on creation for the updated_at field. + port.DefaultUpdatedAt = portDescUpdatedAt.Default.(func() time.Time) + // port.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + port.UpdateDefaultUpdatedAt = portDescUpdatedAt.UpdateDefault.(func() time.Time) + // portDescNumber is the schema descriptor for number field. + portDescNumber := portFields[1].Descriptor() + // port.NumberValidator is a validator for the "number" field. It is called by the builders before save. + port.NumberValidator = func() func(int) error { + validators := portDescNumber.Validators + fns := [...]func(int) error{ + validators[0].(func(int) error), + validators[1].(func(int) error), + validators[2].(func(int) error), + } + return func(number int) error { + for _, fn := range fns { + if err := fn(number); err != nil { + return err + } + } + return nil + } + }() + // portDescLoadBalancerID is the schema descriptor for load_balancer_id field. + portDescLoadBalancerID := portFields[3].Descriptor() + // port.LoadBalancerIDValidator is a validator for the "load_balancer_id" field. It is called by the builders before save. + port.LoadBalancerIDValidator = portDescLoadBalancerID.Validators[0].(func(string) error) + // portDescID is the schema descriptor for id field. + portDescID := portFields[0].Descriptor() + // port.DefaultID holds the default value on creation for the id field. + port.DefaultID = portDescID.Default.(func() gidx.PrefixedID) + providerMixin := schema.Provider{}.Mixin() + providerMixinHooks1 := providerMixin[1].Hooks() + provider.Hooks[0] = providerMixinHooks1[0] + providerMixinFields0 := providerMixin[0].Fields() + _ = providerMixinFields0 + providerFields := schema.Provider{}.Fields() + _ = providerFields + // providerDescCreatedAt is the schema descriptor for created_at field. + providerDescCreatedAt := providerMixinFields0[0].Descriptor() + // provider.DefaultCreatedAt holds the default value on creation for the created_at field. + provider.DefaultCreatedAt = providerDescCreatedAt.Default.(func() time.Time) + // providerDescUpdatedAt is the schema descriptor for updated_at field. + providerDescUpdatedAt := providerMixinFields0[1].Descriptor() + // provider.DefaultUpdatedAt holds the default value on creation for the updated_at field. + provider.DefaultUpdatedAt = providerDescUpdatedAt.Default.(func() time.Time) + // provider.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + provider.UpdateDefaultUpdatedAt = providerDescUpdatedAt.UpdateDefault.(func() time.Time) + // providerDescName is the schema descriptor for name field. + providerDescName := providerFields[1].Descriptor() + // provider.NameValidator is a validator for the "name" field. It is called by the builders before save. + provider.NameValidator = providerDescName.Validators[0].(func(string) error) + // providerDescOwnerID is the schema descriptor for owner_id field. + providerDescOwnerID := providerFields[2].Descriptor() + // provider.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + provider.OwnerIDValidator = providerDescOwnerID.Validators[0].(func(string) error) + // providerDescID is the schema descriptor for id field. + providerDescID := providerFields[0].Descriptor() + // provider.DefaultID holds the default value on creation for the id field. + provider.DefaultID = providerDescID.Default.(func() gidx.PrefixedID) +} const ( Version = "v0.12.4" // Version of ent codegen. diff --git a/internal/ent/schema/audit/doc.go b/internal/ent/schema/audit/doc.go new file mode 100644 index 000000000..17bd6ef2f --- /dev/null +++ b/internal/ent/schema/audit/doc.go @@ -0,0 +1,2 @@ +// Package audit provides a mixin that automatically creates and populates created_by and updated_by fields for schemas where the mixin is configured. +package audit diff --git a/internal/ent/schema/audit/errors.go b/internal/ent/schema/audit/errors.go new file mode 100644 index 000000000..3472b079c --- /dev/null +++ b/internal/ent/schema/audit/errors.go @@ -0,0 +1,10 @@ +package audit + +import ( + "errors" +) + +var ( + // errUnexpectedMutation is returned when an unexpected mutation is encountered + errUnexpectedMutation = errors.New("unexpected mutation type") +) diff --git a/internal/ent/schema/audit/mixin.go b/internal/ent/schema/audit/mixin.go new file mode 100644 index 000000000..dad6063e5 --- /dev/null +++ b/internal/ent/schema/audit/mixin.go @@ -0,0 +1,77 @@ +package audit + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/mixin" + "go.infratographer.com/x/echojwtx" +) + +// Mixin provides auditing for all records where enabled. The created_at, created_by, updated_at, and updated_by records are automatically populated when this mixin is enabled. +type Mixin struct { + mixin.Schema +} + +// Fields of the Mixin +func (Mixin) Fields() []ent.Field { + return []ent.Field{ + field.String("created_by"). + Immutable(). + Annotations( + entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput), + entgql.OrderField("CREATED_BY"), + ). + Optional(), + field.String("updated_by"). + Annotations( + entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput), + entgql.OrderField("UPDATED_BY"), + ). + Optional(), + } +} + +// Hooks of the Mixin +func (Mixin) Hooks() []ent.Hook { + return []ent.Hook{ + Hook, + } +} + +// Hook sets and returns the created_at, updated_at, etc., fields +func Hook(next ent.Mutator) ent.Mutator { + type AuditLogger interface { + SetCreatedBy(string) + CreatedBy() (id string, exists bool) + SetUpdatedBy(string) + UpdatedBy() (id string, exists bool) + } + + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + ml, ok := m.(AuditLogger) + if !ok { + return nil, errUnexpectedMutation + } + + actor := "unknown-actor" + + id, ok := ctx.Value(echojwtx.ActorCtxKey).(string) + if ok { + actor = id + } + + switch op := m.Op(); { + case op.Is(ent.OpCreate): + ml.SetCreatedBy(actor) + ml.SetUpdatedBy(actor) + + case op.Is(ent.OpUpdateOne | ent.OpUpdate): + ml.SetUpdatedBy(actor) + } + + return next.Mutate(ctx, m) + }) +} diff --git a/internal/ent/schema/loadbalancer.go b/internal/ent/schema/loadbalancer.go index a14d53bdb..0b9945f89 100644 --- a/internal/ent/schema/loadbalancer.go +++ b/internal/ent/schema/loadbalancer.go @@ -12,6 +12,7 @@ import ( "go.infratographer.com/x/entx" "go.infratographer.com/x/gidx" + "go.infratographer.com/load-balancer-api/internal/ent/schema/audit" "go.infratographer.com/load-balancer-api/x/pubsubinfo" ) @@ -24,6 +25,7 @@ type LoadBalancer struct { func (LoadBalancer) Mixin() []ent.Mixin { return []ent.Mixin{ entx.NewTimestampMixin(), + audit.Mixin{}, // softdelete.Mixin{}, } } diff --git a/internal/ent/schema/origin.go b/internal/ent/schema/origin.go index a7c88c2e8..e7f181702 100644 --- a/internal/ent/schema/origin.go +++ b/internal/ent/schema/origin.go @@ -11,6 +11,7 @@ import ( "go.infratographer.com/x/entx" "go.infratographer.com/x/gidx" + "go.infratographer.com/load-balancer-api/internal/ent/schema/audit" "go.infratographer.com/load-balancer-api/internal/ent/schema/validations" "go.infratographer.com/load-balancer-api/x/pubsubinfo" ) @@ -26,6 +27,7 @@ type Origin struct { func (Origin) Mixin() []ent.Mixin { return []ent.Mixin{ entx.NewTimestampMixin(), + audit.Mixin{}, } } diff --git a/internal/ent/schema/pool.go b/internal/ent/schema/pool.go index 98432e28d..1f1ae0ef2 100644 --- a/internal/ent/schema/pool.go +++ b/internal/ent/schema/pool.go @@ -11,6 +11,7 @@ import ( "go.infratographer.com/x/entx" "go.infratographer.com/x/gidx" + "go.infratographer.com/load-balancer-api/internal/ent/schema/audit" "go.infratographer.com/load-balancer-api/x/pubsubinfo" ) @@ -23,6 +24,7 @@ type Pool struct { func (Pool) Mixin() []ent.Mixin { return []ent.Mixin{ entx.NewTimestampMixin(), + audit.Mixin{}, } } diff --git a/internal/ent/schema/port.go b/internal/ent/schema/port.go index 47fe46f3c..b16edd17b 100644 --- a/internal/ent/schema/port.go +++ b/internal/ent/schema/port.go @@ -11,6 +11,7 @@ import ( "go.infratographer.com/x/entx" "go.infratographer.com/x/gidx" + "go.infratographer.com/load-balancer-api/internal/ent/schema/audit" "go.infratographer.com/load-balancer-api/internal/ent/schema/validations" "go.infratographer.com/load-balancer-api/x/pubsubinfo" ) @@ -29,6 +30,7 @@ type Port struct { func (Port) Mixin() []ent.Mixin { return []ent.Mixin{ entx.NewTimestampMixin(), + audit.Mixin{}, } } diff --git a/internal/ent/schema/provider.go b/internal/ent/schema/provider.go index 2b2d9ce52..dc0e92b82 100644 --- a/internal/ent/schema/provider.go +++ b/internal/ent/schema/provider.go @@ -10,6 +10,7 @@ import ( "go.infratographer.com/x/entx" "go.infratographer.com/x/gidx" + "go.infratographer.com/load-balancer-api/internal/ent/schema/audit" "go.infratographer.com/load-balancer-api/x/pubsubinfo" ) @@ -22,6 +23,7 @@ type Provider struct { func (Provider) Mixin() []ent.Mixin { return []ent.Mixin{ entx.NewTimestampMixin(), + audit.Mixin{}, } } diff --git a/internal/graphapi/gen_server.go b/internal/graphapi/gen_server.go index a9a6bbd4e..70715d01a 100644 --- a/internal/graphapi/gen_server.go +++ b/internal/graphapi/gen_server.go @@ -68,6 +68,7 @@ type ComplexityRoot struct { LoadBalancer struct { CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int ID func(childComplexity int) int Location func(childComplexity int) int Name func(childComplexity int) int @@ -75,6 +76,7 @@ type ComplexityRoot struct { Ports func(childComplexity int, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerPortOrder, where *generated.LoadBalancerPortWhereInput) int Provider func(childComplexity int) int UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int } LoadBalancerConnection struct { @@ -99,6 +101,7 @@ type ComplexityRoot struct { LoadBalancerOrigin struct { Active func(childComplexity int) int CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int Pool func(childComplexity int) int @@ -106,6 +109,7 @@ type ComplexityRoot struct { PortNumber func(childComplexity int) int Target func(childComplexity int) int UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int Weight func(childComplexity int) int } @@ -134,6 +138,7 @@ type ComplexityRoot struct { LoadBalancerPool struct { CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int Origins func(childComplexity int, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOriginOrder, where *generated.LoadBalancerOriginWhereInput) int @@ -142,6 +147,7 @@ type ComplexityRoot struct { Ports func(childComplexity int) int Protocol func(childComplexity int) int UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int } LoadBalancerPoolConnection struct { @@ -169,6 +175,7 @@ type ComplexityRoot struct { LoadBalancerPort struct { CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int ID func(childComplexity int) int LoadBalancer func(childComplexity int) int LoadBalancerID func(childComplexity int) int @@ -176,6 +183,7 @@ type ComplexityRoot struct { Number func(childComplexity int) int Pools func(childComplexity int) int UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int } LoadBalancerPortConnection struct { @@ -203,11 +211,13 @@ type ComplexityRoot struct { LoadBalancerProvider struct { CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int ID func(childComplexity int) int LoadBalancers func(childComplexity int, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerWhereInput) int Name func(childComplexity int) int Owner func(childComplexity int) int UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int } LoadBalancerProviderConnection struct { @@ -445,6 +455,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancer.CreatedAt(childComplexity), true + case "LoadBalancer.createdBy": + if e.complexity.LoadBalancer.CreatedBy == nil { + break + } + + return e.complexity.LoadBalancer.CreatedBy(childComplexity), true + case "LoadBalancer.id": if e.complexity.LoadBalancer.ID == nil { break @@ -499,6 +516,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancer.UpdatedAt(childComplexity), true + case "LoadBalancer.updatedBy": + if e.complexity.LoadBalancer.UpdatedBy == nil { + break + } + + return e.complexity.LoadBalancer.UpdatedBy(childComplexity), true + case "LoadBalancerConnection.edges": if e.complexity.LoadBalancerConnection.Edges == nil { break @@ -562,6 +586,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancerOrigin.CreatedAt(childComplexity), true + case "LoadBalancerOrigin.createdBy": + if e.complexity.LoadBalancerOrigin.CreatedBy == nil { + break + } + + return e.complexity.LoadBalancerOrigin.CreatedBy(childComplexity), true + case "LoadBalancerOrigin.id": if e.complexity.LoadBalancerOrigin.ID == nil { break @@ -611,6 +642,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancerOrigin.UpdatedAt(childComplexity), true + case "LoadBalancerOrigin.updatedBy": + if e.complexity.LoadBalancerOrigin.UpdatedBy == nil { + break + } + + return e.complexity.LoadBalancerOrigin.UpdatedBy(childComplexity), true + case "LoadBalancerOrigin.weight": if e.complexity.LoadBalancerOrigin.Weight == nil { break @@ -681,6 +719,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancerPool.CreatedAt(childComplexity), true + case "LoadBalancerPool.createdBy": + if e.complexity.LoadBalancerPool.CreatedBy == nil { + break + } + + return e.complexity.LoadBalancerPool.CreatedBy(childComplexity), true + case "LoadBalancerPool.id": if e.complexity.LoadBalancerPool.ID == nil { break @@ -742,6 +787,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancerPool.UpdatedAt(childComplexity), true + case "LoadBalancerPool.updatedBy": + if e.complexity.LoadBalancerPool.UpdatedBy == nil { + break + } + + return e.complexity.LoadBalancerPool.UpdatedBy(childComplexity), true + case "LoadBalancerPoolConnection.edges": if e.complexity.LoadBalancerPoolConnection.Edges == nil { break @@ -805,6 +857,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancerPort.CreatedAt(childComplexity), true + case "LoadBalancerPort.createdBy": + if e.complexity.LoadBalancerPort.CreatedBy == nil { + break + } + + return e.complexity.LoadBalancerPort.CreatedBy(childComplexity), true + case "LoadBalancerPort.id": if e.complexity.LoadBalancerPort.ID == nil { break @@ -854,6 +913,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancerPort.UpdatedAt(childComplexity), true + case "LoadBalancerPort.updatedBy": + if e.complexity.LoadBalancerPort.UpdatedBy == nil { + break + } + + return e.complexity.LoadBalancerPort.UpdatedBy(childComplexity), true + case "LoadBalancerPortConnection.edges": if e.complexity.LoadBalancerPortConnection.Edges == nil { break @@ -917,6 +983,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancerProvider.CreatedAt(childComplexity), true + case "LoadBalancerProvider.createdBy": + if e.complexity.LoadBalancerProvider.CreatedBy == nil { + break + } + + return e.complexity.LoadBalancerProvider.CreatedBy(childComplexity), true + case "LoadBalancerProvider.id": if e.complexity.LoadBalancerProvider.ID == nil { break @@ -957,6 +1030,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancerProvider.UpdatedAt(childComplexity), true + case "LoadBalancerProvider.updatedBy": + if e.complexity.LoadBalancerProvider.UpdatedBy == nil { + break + } + + return e.complexity.LoadBalancerProvider.UpdatedBy(childComplexity), true + case "LoadBalancerProviderConnection.edges": if e.complexity.LoadBalancerProviderConnection.Edges == nil { break @@ -1554,6 +1634,8 @@ type LoadBalancer implements Node & IPAddressable & MetadataNode @key(fields: "i id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String """The name of the load balancer.""" name: String! ports( @@ -1606,6 +1688,8 @@ enum LoadBalancerOrderField { ID CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY NAME OWNER } @@ -1613,6 +1697,8 @@ type LoadBalancerOrigin implements Node @key(fields: "id") @prefixedID(prefix: " id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String name: String! weight: Int! target: String! @@ -1648,6 +1734,8 @@ input LoadBalancerOriginOrder { enum LoadBalancerOriginOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY name weight target @@ -1689,6 +1777,38 @@ input LoadBalancerOriginWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -1746,6 +1866,8 @@ type LoadBalancerPool implements Node @key(fields: "id") @prefixedID(prefix: "lo id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String name: String! protocol: LoadBalancerPoolProtocol! ownerID: ID! @@ -1797,6 +1919,8 @@ input LoadBalancerPoolOrder { enum LoadBalancerPoolOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY name protocol } @@ -1840,6 +1964,38 @@ input LoadBalancerPoolWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -1870,6 +2026,8 @@ type LoadBalancerPort implements Node @key(fields: "id") @prefixedID(prefix: "lo id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String number: Int! name: String! loadBalancerID: ID! @@ -1903,6 +2061,8 @@ input LoadBalancerPortOrder { enum LoadBalancerPortOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY number name } @@ -1941,6 +2101,38 @@ input LoadBalancerPortWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """number field predicates""" number: Int numberNEQ: Int @@ -1976,6 +2168,8 @@ type LoadBalancerProvider implements Node @key(fields: "id") @prefixedID(prefix: id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String """The name of the load balancer provider.""" name: String! loadBalancers( @@ -2026,6 +2220,8 @@ enum LoadBalancerProviderOrderField { ID CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY NAME OWNER } @@ -2064,6 +2260,38 @@ input LoadBalancerProviderWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -2117,6 +2345,38 @@ input LoadBalancerWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -3789,6 +4049,10 @@ func (ec *executionContext) fieldContext_Entity_findLoadBalancerByID(ctx context return ec.fieldContext_LoadBalancer_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancer_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancer_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancer_name(ctx, field) case "ports": @@ -3862,6 +4126,10 @@ func (ec *executionContext) fieldContext_Entity_findLoadBalancerOriginByID(ctx c return ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerOrigin_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerOrigin_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerOrigin_name(ctx, field) case "weight": @@ -3939,6 +4207,10 @@ func (ec *executionContext) fieldContext_Entity_findLoadBalancerPoolByID(ctx con return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPool_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPool_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerPool_name(ctx, field) case "protocol": @@ -4014,6 +4286,10 @@ func (ec *executionContext) fieldContext_Entity_findLoadBalancerPortByID(ctx con return ec.fieldContext_LoadBalancerPort_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerPort_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPort_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPort_updatedBy(ctx, field) case "number": return ec.fieldContext_LoadBalancerPort_number(ctx, field) case "name": @@ -4087,6 +4363,10 @@ func (ec *executionContext) fieldContext_Entity_findLoadBalancerProviderByID(ctx return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerProvider_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerProvider_name(ctx, field) case "loadBalancers": @@ -4369,6 +4649,88 @@ func (ec *executionContext) fieldContext_LoadBalancer_updatedAt(ctx context.Cont return fc, nil } +func (ec *executionContext) _LoadBalancer_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancer_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LoadBalancer_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LoadBalancer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _LoadBalancer_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancer_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LoadBalancer_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LoadBalancer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _LoadBalancer_name(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancer) (ret graphql.Marshaler) { fc, err := ec.fieldContext_LoadBalancer_name(ctx, field) if err != nil { @@ -4521,6 +4883,10 @@ func (ec *executionContext) fieldContext_LoadBalancer_loadBalancerProvider(ctx c return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerProvider_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerProvider_name(ctx, field) case "loadBalancers": @@ -4828,6 +5194,10 @@ func (ec *executionContext) fieldContext_LoadBalancerCreatePayload_loadBalancer( return ec.fieldContext_LoadBalancer_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancer_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancer_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancer_name(ctx, field) case "ports": @@ -4931,6 +5301,10 @@ func (ec *executionContext) fieldContext_LoadBalancerEdge_node(ctx context.Conte return ec.fieldContext_LoadBalancer_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancer_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancer_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancer_name(ctx, field) case "ports": @@ -5124,6 +5498,88 @@ func (ec *executionContext) fieldContext_LoadBalancerOrigin_updatedAt(ctx contex return fc, nil } +func (ec *executionContext) _LoadBalancerOrigin_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOrigin_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LoadBalancerOrigin_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LoadBalancerOrigin", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _LoadBalancerOrigin_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOrigin_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LoadBalancerOrigin_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LoadBalancerOrigin", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _LoadBalancerOrigin_name(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { fc, err := ec.fieldContext_LoadBalancerOrigin_name(ctx, field) if err != nil { @@ -5433,6 +5889,10 @@ func (ec *executionContext) fieldContext_LoadBalancerOrigin_pool(ctx context.Con return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPool_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPool_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerPool_name(ctx, field) case "protocol": @@ -5642,6 +6102,10 @@ func (ec *executionContext) fieldContext_LoadBalancerOriginCreatePayload_loadBal return ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerOrigin_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerOrigin_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerOrigin_name(ctx, field) case "weight": @@ -5749,6 +6213,10 @@ func (ec *executionContext) fieldContext_LoadBalancerOriginEdge_node(ctx context return ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerOrigin_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerOrigin_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerOrigin_name(ctx, field) case "weight": @@ -5859,6 +6327,10 @@ func (ec *executionContext) fieldContext_LoadBalancerOriginUpdatePayload_loadBal return ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerOrigin_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerOrigin_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerOrigin_name(ctx, field) case "weight": @@ -6012,8 +6484,8 @@ func (ec *executionContext) fieldContext_LoadBalancerPool_updatedAt(ctx context. return fc, nil } -func (ec *executionContext) _LoadBalancerPool_name(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPool_name(ctx, field) +func (ec *executionContext) _LoadBalancerPool_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPool_createdBy(ctx, field) if err != nil { return graphql.Null } @@ -6026,24 +6498,21 @@ func (ec *executionContext) _LoadBalancerPool_name(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.CreatedBy, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } res := resTmp.(string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPool_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPool_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "LoadBalancerPool", Field: field, @@ -6056,8 +6525,8 @@ func (ec *executionContext) fieldContext_LoadBalancerPool_name(ctx context.Conte return fc, nil } -func (ec *executionContext) _LoadBalancerPool_protocol(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPool_protocol(ctx, field) +func (ec *executionContext) _LoadBalancerPool_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPool_updatedBy(ctx, field) if err != nil { return graphql.Null } @@ -6070,38 +6539,35 @@ func (ec *executionContext) _LoadBalancerPool_protocol(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Protocol, nil + return obj.UpdatedBy, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(pool.Protocol) + res := resTmp.(string) fc.Result = res - return ec.marshalNLoadBalancerPoolProtocol2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocol(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPool_protocol(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPool_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "LoadBalancerPool", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type LoadBalancerPoolProtocol does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPool_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) +func (ec *executionContext) _LoadBalancerPool_name(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPool_name(ctx, field) if err != nil { return graphql.Null } @@ -6114,7 +6580,7 @@ func (ec *executionContext) _LoadBalancerPool_ownerID(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.OwnerID, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -6126,26 +6592,26 @@ func (ec *executionContext) _LoadBalancerPool_ownerID(ctx context.Context, field } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.(string) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPool_ownerID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPool_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "LoadBalancerPool", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPool_ports(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPool_ports(ctx, field) +func (ec *executionContext) _LoadBalancerPool_protocol(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPool_protocol(ctx, field) if err != nil { return graphql.Null } @@ -6158,42 +6624,134 @@ func (ec *executionContext) _LoadBalancerPool_ports(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Ports(ctx) + return obj.Protocol, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*generated.Port) + res := resTmp.(pool.Protocol) fc.Result = res - return ec.marshalOLoadBalancerPort2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPortᚄ(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPoolProtocol2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocol(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPool_ports(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPool_protocol(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "LoadBalancerPool", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerPort_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerPort_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerPort_updatedAt(ctx, field) - case "number": - return ec.fieldContext_LoadBalancerPort_number(ctx, field) - case "name": - return ec.fieldContext_LoadBalancerPort_name(ctx, field) - case "loadBalancerID": - return ec.fieldContext_LoadBalancerPort_loadBalancerID(ctx, field) - case "pools": - return ec.fieldContext_LoadBalancerPort_pools(ctx, field) + return nil, errors.New("field of type LoadBalancerPoolProtocol does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _LoadBalancerPool_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(gidx.PrefixedID) + fc.Result = res + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LoadBalancerPool_ownerID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LoadBalancerPool", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _LoadBalancerPool_ports(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPool_ports(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ports(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Port) + fc.Result = res + return ec.marshalOLoadBalancerPort2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPortᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LoadBalancerPool_ports(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LoadBalancerPool", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_LoadBalancerPort_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerPort_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerPort_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPort_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPort_updatedBy(ctx, field) + case "number": + return ec.fieldContext_LoadBalancerPort_number(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerPort_name(ctx, field) + case "loadBalancerID": + return ec.fieldContext_LoadBalancerPort_loadBalancerID(ctx, field) + case "pools": + return ec.fieldContext_LoadBalancerPort_pools(ctx, field) case "loadBalancer": return ec.fieldContext_LoadBalancerPort_loadBalancer(ctx, field) } @@ -6510,6 +7068,10 @@ func (ec *executionContext) fieldContext_LoadBalancerPoolCreatePayload_loadBalan return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPool_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPool_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerPool_name(ctx, field) case "protocol": @@ -6612,6 +7174,10 @@ func (ec *executionContext) fieldContext_LoadBalancerPoolEdge_node(ctx context.C return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPool_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPool_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerPool_name(ctx, field) case "protocol": @@ -6720,6 +7286,10 @@ func (ec *executionContext) fieldContext_LoadBalancerPoolUpdatePayload_loadBalan return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPool_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPool_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerPool_name(ctx, field) case "protocol": @@ -6871,6 +7441,88 @@ func (ec *executionContext) fieldContext_LoadBalancerPort_updatedAt(ctx context. return fc, nil } +func (ec *executionContext) _LoadBalancerPort_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPort_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LoadBalancerPort_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LoadBalancerPort", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _LoadBalancerPort_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPort_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LoadBalancerPort_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LoadBalancerPort", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _LoadBalancerPort_number(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { fc, err := ec.fieldContext_LoadBalancerPort_number(ctx, field) if err != nil { @@ -7045,6 +7697,10 @@ func (ec *executionContext) fieldContext_LoadBalancerPort_pools(ctx context.Cont return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPool_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPool_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerPool_name(ctx, field) case "protocol": @@ -7109,6 +7765,10 @@ func (ec *executionContext) fieldContext_LoadBalancerPort_loadBalancer(ctx conte return ec.fieldContext_LoadBalancer_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancer_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancer_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancer_name(ctx, field) case "ports": @@ -7316,6 +7976,10 @@ func (ec *executionContext) fieldContext_LoadBalancerPortCreatePayload_loadBalan return ec.fieldContext_LoadBalancerPort_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerPort_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPort_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPort_updatedBy(ctx, field) case "number": return ec.fieldContext_LoadBalancerPort_number(ctx, field) case "name": @@ -7419,6 +8083,10 @@ func (ec *executionContext) fieldContext_LoadBalancerPortEdge_node(ctx context.C return ec.fieldContext_LoadBalancerPort_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerPort_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPort_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPort_updatedBy(ctx, field) case "number": return ec.fieldContext_LoadBalancerPort_number(ctx, field) case "name": @@ -7525,6 +8193,10 @@ func (ec *executionContext) fieldContext_LoadBalancerPortUpdatePayload_loadBalan return ec.fieldContext_LoadBalancerPort_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerPort_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPort_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPort_updatedBy(ctx, field) case "number": return ec.fieldContext_LoadBalancerPort_number(ctx, field) case "name": @@ -7674,6 +8346,88 @@ func (ec *executionContext) fieldContext_LoadBalancerProvider_updatedAt(ctx cont return fc, nil } +func (ec *executionContext) _LoadBalancerProvider_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProvider_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LoadBalancerProvider_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LoadBalancerProvider", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _LoadBalancerProvider_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProvider_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LoadBalancerProvider_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LoadBalancerProvider", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _LoadBalancerProvider_name(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { fc, err := ec.fieldContext_LoadBalancerProvider_name(ctx, field) if err != nil { @@ -8025,6 +8779,10 @@ func (ec *executionContext) fieldContext_LoadBalancerProviderCreatePayload_loadB return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerProvider_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerProvider_name(ctx, field) case "loadBalancers": @@ -8124,6 +8882,10 @@ func (ec *executionContext) fieldContext_LoadBalancerProviderEdge_node(ctx conte return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerProvider_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerProvider_name(ctx, field) case "loadBalancers": @@ -8226,6 +8988,10 @@ func (ec *executionContext) fieldContext_LoadBalancerProviderUpdatePayload_loadB return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerProvider_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerProvider_name(ctx, field) case "loadBalancers": @@ -8284,6 +9050,10 @@ func (ec *executionContext) fieldContext_LoadBalancerUpdatePayload_loadBalancer( return ec.fieldContext_LoadBalancer_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancer_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancer_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancer_name(ctx, field) case "ports": @@ -9571,6 +10341,10 @@ func (ec *executionContext) fieldContext_Query_loadBalancer(ctx context.Context, return ec.fieldContext_LoadBalancer_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancer_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancer_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancer_name(ctx, field) case "ports": @@ -9644,6 +10418,10 @@ func (ec *executionContext) fieldContext_Query_loadBalancerPool(ctx context.Cont return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerPool_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerPool_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerPool_name(ctx, field) case "protocol": @@ -9719,6 +10497,10 @@ func (ec *executionContext) fieldContext_Query_loadBalancerProvider(ctx context. return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_LoadBalancerProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_LoadBalancerProvider_updatedBy(ctx, field) case "name": return ec.fieldContext_LoadBalancerProvider_name(ctx, field) case "loadBalancers": @@ -12411,7 +13193,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerOriginWhereInput(ctx conte asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "weight", "weightNEQ", "weightIn", "weightNotIn", "weightGT", "weightGTE", "weightLT", "weightLTE", "target", "targetNEQ", "targetIn", "targetNotIn", "targetGT", "targetGTE", "targetLT", "targetLTE", "targetContains", "targetHasPrefix", "targetHasSuffix", "targetEqualFold", "targetContainsFold", "portNumber", "portNumberNEQ", "portNumberIn", "portNumberNotIn", "portNumberGT", "portNumberGTE", "portNumberLT", "portNumberLTE", "active", "activeNEQ", "hasPool", "hasPoolWith"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "weight", "weightNEQ", "weightIn", "weightNotIn", "weightGT", "weightGTE", "weightLT", "weightLTE", "target", "targetNEQ", "targetIn", "targetNotIn", "targetGT", "targetGTE", "targetLT", "targetLTE", "targetContains", "targetHasPrefix", "targetHasSuffix", "targetEqualFold", "targetContainsFold", "portNumber", "portNumberNEQ", "portNumberIn", "portNumberNotIn", "portNumberGT", "portNumberGTE", "portNumberLT", "portNumberLTE", "active", "activeNEQ", "hasPool", "hasPoolWith"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -12661,28 +13443,298 @@ func (ec *executionContext) unmarshalInputLoadBalancerOriginWhereInput(ctx conte return it, err } it.UpdatedAtLTE = data - case "name": + case "createdBy": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Name = data - case "nameNEQ": + it.CreatedBy = data + case "createdByNEQ": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNEQ")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameNEQ = data - case "nameIn": + it.CreatedByNEQ = data + case "createdByIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIn")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "nameNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameNEQ = data + case "nameIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err @@ -13130,7 +14182,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerPoolWhereInput(ctx context asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "protocol", "protocolNEQ", "protocolIn", "protocolNotIn", "hasPorts", "hasPortsWith", "hasOrigins", "hasOriginsWith"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "protocol", "protocolNEQ", "protocolIn", "protocolNotIn", "hasPorts", "hasPortsWith", "hasOrigins", "hasOriginsWith"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -13380,168 +14432,438 @@ func (ec *executionContext) unmarshalInputLoadBalancerPoolWhereInput(ctx context return it, err } it.UpdatedAtLTE = data - case "name": + case "createdBy": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Name = data - case "nameNEQ": + it.CreatedBy = data + case "createdByNEQ": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNEQ")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameNEQ = data - case "nameIn": + it.CreatedByNEQ = data + case "createdByIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIn")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.NameIn = data - case "nameNotIn": + it.CreatedByIn = data + case "createdByNotIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNotIn")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.NameNotIn = data - case "nameGT": + it.CreatedByNotIn = data + case "createdByGT": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameGT")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameGT = data - case "nameGTE": + it.CreatedByGT = data + case "createdByGTE": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameGTE")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameGTE = data - case "nameLT": + it.CreatedByGTE = data + case "createdByLT": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameLT")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameLT = data - case "nameLTE": + it.CreatedByLT = data + case "createdByLTE": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameLTE")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameLTE = data - case "nameContains": + it.CreatedByLTE = data + case "createdByContains": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContains")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameContains = data - case "nameHasPrefix": + it.CreatedByContains = data + case "createdByHasPrefix": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasPrefix")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameHasPrefix = data - case "nameHasSuffix": + it.CreatedByHasPrefix = data + case "createdByHasSuffix": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasSuffix")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameHasSuffix = data - case "nameEqualFold": + it.CreatedByHasSuffix = data + case "createdByIsNil": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.NameEqualFold = data - case "nameContainsFold": + it.CreatedByIsNil = data + case "createdByNotNil": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContainsFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.NameContainsFold = data - case "protocol": + it.CreatedByNotNil = data + case "createdByEqualFold": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("protocol")) - data, err := ec.unmarshalOLoadBalancerPoolProtocol2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocol(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Protocol = data - case "protocolNEQ": + it.CreatedByEqualFold = data + case "createdByContainsFold": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("protocolNEQ")) - data, err := ec.unmarshalOLoadBalancerPoolProtocol2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocol(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ProtocolNEQ = data - case "protocolIn": + it.CreatedByContainsFold = data + case "updatedBy": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("protocolIn")) - data, err := ec.unmarshalOLoadBalancerPoolProtocol2ᚕgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocolᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ProtocolIn = data - case "protocolNotIn": + it.UpdatedBy = data + case "updatedByNEQ": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("protocolNotIn")) - data, err := ec.unmarshalOLoadBalancerPoolProtocol2ᚕgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocolᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ProtocolNotIn = data - case "hasPorts": + it.UpdatedByNEQ = data + case "updatedByIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPorts")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.HasPorts = data + it.UpdatedByIn = data + case "updatedByNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "nameNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameNEQ = data + case "nameIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.NameIn = data + case "nameNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.NameNotIn = data + case "nameGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameGT = data + case "nameGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameGTE = data + case "nameLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameLT = data + case "nameLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameLTE = data + case "nameContains": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameContains = data + case "nameHasPrefix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameHasPrefix = data + case "nameHasSuffix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameHasSuffix = data + case "nameEqualFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameEqualFold = data + case "nameContainsFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameContainsFold = data + case "protocol": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("protocol")) + data, err := ec.unmarshalOLoadBalancerPoolProtocol2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocol(ctx, v) + if err != nil { + return it, err + } + it.Protocol = data + case "protocolNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("protocolNEQ")) + data, err := ec.unmarshalOLoadBalancerPoolProtocol2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocol(ctx, v) + if err != nil { + return it, err + } + it.ProtocolNEQ = data + case "protocolIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("protocolIn")) + data, err := ec.unmarshalOLoadBalancerPoolProtocol2ᚕgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocolᚄ(ctx, v) + if err != nil { + return it, err + } + it.ProtocolIn = data + case "protocolNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("protocolNotIn")) + data, err := ec.unmarshalOLoadBalancerPoolProtocol2ᚕgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocolᚄ(ctx, v) + if err != nil { + return it, err + } + it.ProtocolNotIn = data + case "hasPorts": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPorts")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasPorts = data case "hasPortsWith": var err error @@ -13624,7 +14946,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerPortWhereInput(ctx context asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "number", "numberNEQ", "numberIn", "numberNotIn", "numberGT", "numberGTE", "numberLT", "numberLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "hasPools", "hasPoolsWith", "hasLoadBalancer", "hasLoadBalancerWith"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "number", "numberNEQ", "numberIn", "numberNotIn", "numberGT", "numberGTE", "numberLT", "numberLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "hasPools", "hasPoolsWith", "hasLoadBalancer", "hasLoadBalancerWith"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -13823,57 +15145,327 @@ func (ec *executionContext) unmarshalInputLoadBalancerPortWhereInput(ctx context case "updatedAtIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) - data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "createdBy": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.UpdatedAtIn = data - case "updatedAtNotIn": + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) - data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.UpdatedAtNotIn = data - case "updatedAtGT": + it.UpdatedByHasSuffix = data + case "updatedByIsNil": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.UpdatedAtGT = data - case "updatedAtGTE": + it.UpdatedByIsNil = data + case "updatedByNotNil": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.UpdatedAtGTE = data - case "updatedAtLT": + it.UpdatedByNotNil = data + case "updatedByEqualFold": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.UpdatedAtLT = data - case "updatedAtLTE": + it.UpdatedByEqualFold = data + case "updatedByContainsFold": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.UpdatedAtLTE = data + it.UpdatedByContainsFold = data case "number": var err error @@ -14154,7 +15746,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerProviderWhereInput(ctx con asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "hasLoadBalancers", "hasLoadBalancersWith"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "hasLoadBalancers", "hasLoadBalancersWith"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -14268,142 +15860,412 @@ func (ec *executionContext) unmarshalInputLoadBalancerProviderWhereInput(ctx con if err != nil { return it, err } - it.CreatedAt = data - case "createdAtNEQ": + it.CreatedAt = data + case "createdAtNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "updatedAt": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "createdBy": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CreatedAtNEQ = data - case "createdAtIn": + it.UpdatedBy = data + case "updatedByNEQ": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) - data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CreatedAtIn = data - case "createdAtNotIn": + it.UpdatedByNEQ = data + case "updatedByIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) - data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.CreatedAtNotIn = data - case "createdAtGT": + it.UpdatedByIn = data + case "updatedByNotIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.CreatedAtGT = data - case "createdAtGTE": + it.UpdatedByNotIn = data + case "updatedByGT": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CreatedAtGTE = data - case "createdAtLT": + it.UpdatedByGT = data + case "updatedByGTE": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CreatedAtLT = data - case "createdAtLTE": + it.UpdatedByGTE = data + case "updatedByLT": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CreatedAtLTE = data - case "updatedAt": + it.UpdatedByLT = data + case "updatedByLTE": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.UpdatedAt = data - case "updatedAtNEQ": + it.UpdatedByLTE = data + case "updatedByContains": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.UpdatedAtNEQ = data - case "updatedAtIn": + it.UpdatedByContains = data + case "updatedByHasPrefix": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) - data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.UpdatedAtIn = data - case "updatedAtNotIn": + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) - data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.UpdatedAtNotIn = data - case "updatedAtGT": + it.UpdatedByHasSuffix = data + case "updatedByIsNil": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.UpdatedAtGT = data - case "updatedAtGTE": + it.UpdatedByIsNil = data + case "updatedByNotNil": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.UpdatedAtGTE = data - case "updatedAtLT": + it.UpdatedByNotNil = data + case "updatedByEqualFold": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.UpdatedAtLT = data - case "updatedAtLTE": + it.UpdatedByEqualFold = data + case "updatedByContainsFold": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.UpdatedAtLTE = data + it.UpdatedByContainsFold = data case "name": var err error @@ -14552,7 +16414,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerWhereInput(ctx context.Con asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "hasPorts", "hasPortsWith", "hasProvider", "hasProviderWith"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "hasPorts", "hasPortsWith", "hasProvider", "hasProviderWith"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -14802,6 +16664,276 @@ func (ec *executionContext) unmarshalInputLoadBalancerWhereInput(ctx context.Con return it, err } it.UpdatedAtLTE = data + case "createdBy": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data case "name": var err error @@ -15622,6 +17754,10 @@ func (ec *executionContext) _LoadBalancer(ctx context.Context, sel ast.Selection if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } + case "createdBy": + out.Values[i] = ec._LoadBalancer_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._LoadBalancer_updatedBy(ctx, field, obj) case "name": out.Values[i] = ec._LoadBalancer_name(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -15985,6 +18121,10 @@ func (ec *executionContext) _LoadBalancerOrigin(ctx context.Context, sel ast.Sel if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } + case "createdBy": + out.Values[i] = ec._LoadBalancerOrigin_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._LoadBalancerOrigin_updatedBy(ctx, field, obj) case "name": out.Values[i] = ec._LoadBalancerOrigin_name(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -16304,6 +18444,10 @@ func (ec *executionContext) _LoadBalancerPool(ctx context.Context, sel ast.Selec if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } + case "createdBy": + out.Values[i] = ec._LoadBalancerPool_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._LoadBalancerPool_updatedBy(ctx, field, obj) case "name": out.Values[i] = ec._LoadBalancerPool_name(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -16674,6 +18818,10 @@ func (ec *executionContext) _LoadBalancerPort(ctx context.Context, sel ast.Selec if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } + case "createdBy": + out.Values[i] = ec._LoadBalancerPort_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._LoadBalancerPort_updatedBy(ctx, field, obj) case "number": out.Values[i] = ec._LoadBalancerPort_number(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -17011,6 +19159,10 @@ func (ec *executionContext) _LoadBalancerProvider(ctx context.Context, sel ast.S if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } + case "createdBy": + out.Values[i] = ec._LoadBalancerProvider_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._LoadBalancerProvider_updatedBy(ctx, field, obj) case "name": out.Values[i] = ec._LoadBalancerProvider_name(ctx, field, obj) if out.Values[i] == graphql.Null { diff --git a/internal/graphapi/loadbalancer.resolvers.go b/internal/graphapi/loadbalancer.resolvers.go index b151fa407..6586b1522 100644 --- a/internal/graphapi/loadbalancer.resolvers.go +++ b/internal/graphapi/loadbalancer.resolvers.go @@ -8,16 +8,16 @@ import ( "context" "database/sql" - "go.infratographer.com/permissions-api/pkg/permissions" - "go.infratographer.com/x/events" - "go.infratographer.com/x/gidx" - "go.infratographer.com/load-balancer-api/internal/config" "go.infratographer.com/load-balancer-api/internal/ent/generated" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" "go.infratographer.com/load-balancer-api/internal/ent/generated/port" "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" + _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" "go.infratographer.com/load-balancer-api/pkg/metadata" + "go.infratographer.com/permissions-api/pkg/permissions" + "go.infratographer.com/x/events" + "go.infratographer.com/x/gidx" ) // LoadBalancerCreate is the resolver for the loadBalancerCreate field. diff --git a/internal/graphapi/loadbalancer_test.go b/internal/graphapi/loadbalancer_test.go index f4249724c..bc1fa420c 100644 --- a/internal/graphapi/loadbalancer_test.go +++ b/internal/graphapi/loadbalancer_test.go @@ -62,6 +62,7 @@ func TestQuery_loadBalancer(t *testing.T) { for _, tt := range testCases { t.Run(tt.TestName, func(t *testing.T) { tt := tt + t.Parallel() resp, err := graphTestClient().GetLoadBalancer(ctx, tt.QueryID) @@ -133,6 +134,7 @@ func TestCreate_loadBalancer(t *testing.T) { for _, tt := range testCases { t.Run(tt.TestName, func(t *testing.T) { tt := tt + t.Parallel() resp, err := graphTestClient().LoadBalancerCreate(ctx, tt.Input) @@ -197,7 +199,9 @@ func TestCreate_loadBalancer_limit(t *testing.T) { for _, tt := range testCases { t.Run(tt.TestName, func(t *testing.T) { tt := tt + t.Parallel() + var err error for i := 1; i < tt.lbCount; i++ { @@ -210,6 +214,7 @@ func TestCreate_loadBalancer_limit(t *testing.T) { if tt.errorMsg != "" { require.Error(t, err) assert.ErrorContains(t, err, tt.errorMsg) + return } diff --git a/internal/graphapi/location.resolvers.go b/internal/graphapi/location.resolvers.go index 008884756..13256ef46 100644 --- a/internal/graphapi/location.resolvers.go +++ b/internal/graphapi/location.resolvers.go @@ -10,6 +10,7 @@ import ( "entgo.io/contrib/entgql" "go.infratographer.com/load-balancer-api/internal/ent/generated" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" + _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" "go.infratographer.com/x/gidx" ) diff --git a/internal/graphapi/metadata.go b/internal/graphapi/metadata.go index 7292462b0..85fde0714 100644 --- a/internal/graphapi/metadata.go +++ b/internal/graphapi/metadata.go @@ -10,6 +10,8 @@ import ( metastatus "go.infratographer.com/load-balancer-api/pkg/metadata" "go.infratographer.com/load-balancer-api/internal/config" + + _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" // imports the generated runtime package to instantiate the appropriate default values ) const metadataStatusSource = "load-balancer-api" diff --git a/internal/graphapi/origin.resolvers.go b/internal/graphapi/origin.resolvers.go index 71e1c4a25..d17f96f22 100644 --- a/internal/graphapi/origin.resolvers.go +++ b/internal/graphapi/origin.resolvers.go @@ -7,14 +7,14 @@ package graphapi import ( "context" - "go.infratographer.com/permissions-api/pkg/permissions" - "go.infratographer.com/x/gidx" - "go.infratographer.com/load-balancer-api/internal/ent/generated" "go.infratographer.com/load-balancer-api/internal/ent/generated/origin" "go.infratographer.com/load-balancer-api/internal/ent/generated/pool" "go.infratographer.com/load-balancer-api/internal/ent/generated/port" + _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" "go.infratographer.com/load-balancer-api/pkg/metadata" + "go.infratographer.com/permissions-api/pkg/permissions" + "go.infratographer.com/x/gidx" ) // LoadBalancerOriginCreate is the resolver for the loadBalancerOriginCreate field. diff --git a/internal/graphapi/origin_test.go b/internal/graphapi/origin_test.go index 7f854d44f..b183f9af8 100644 --- a/internal/graphapi/origin_test.go +++ b/internal/graphapi/origin_test.go @@ -64,6 +64,7 @@ func TestQueryPoolOrigin(t *testing.T) { require.Error(t, err) assert.ErrorContains(t, err, tt.errorMsg) assert.Nil(t, poolOriginResp) + return } @@ -213,6 +214,7 @@ func TestMutate_OriginCreate(t *testing.T) { require.Error(t, err) assert.ErrorContains(t, err, tt.errorMsg) assert.Nil(t, createdOriginResp) + return } @@ -305,6 +307,7 @@ func TestMutate_OriginUpdate(t *testing.T) { require.Error(t, err) assert.ErrorContains(t, err, tt.errorMsg) assert.Nil(t, updatedOriginResp) + return } @@ -368,6 +371,7 @@ func TestMutate_OriginDelete(t *testing.T) { require.Error(t, err) assert.ErrorContains(t, err, tt.errorMsg) assert.Nil(t, deletedOriginResp) + return } diff --git a/internal/graphapi/owner.resolvers.go b/internal/graphapi/owner.resolvers.go index 93c9ab4f2..21877a190 100644 --- a/internal/graphapi/owner.resolvers.go +++ b/internal/graphapi/owner.resolvers.go @@ -12,6 +12,7 @@ import ( "go.infratographer.com/load-balancer-api/internal/ent/generated" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" "go.infratographer.com/load-balancer-api/internal/ent/generated/pool" + _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" "go.infratographer.com/x/gidx" ) diff --git a/internal/graphapi/owner_resolvers_test.go b/internal/graphapi/owner_resolvers_test.go index e5e3bc97d..13118df9e 100644 --- a/internal/graphapi/owner_resolvers_test.go +++ b/internal/graphapi/owner_resolvers_test.go @@ -96,6 +96,7 @@ func TestOwnerLoadBalancersResolver(t *testing.T) { } require.Len(t, resp.Entities[0].LoadBalancers.Edges, len(tt.ResponseOrder)) + for i, lb := range tt.ResponseOrder { respLB := resp.Entities[0].LoadBalancers.Edges[i].Node require.Equal(t, lb.ID, respLB.ID) diff --git a/internal/graphapi/pool.resolvers.go b/internal/graphapi/pool.resolvers.go index 12c295439..4d6c0b32d 100644 --- a/internal/graphapi/pool.resolvers.go +++ b/internal/graphapi/pool.resolvers.go @@ -8,17 +8,17 @@ import ( "context" "database/sql" - "go.infratographer.com/permissions-api/pkg/permissions" - "go.infratographer.com/x/gidx" - "golang.org/x/exp/slices" - "go.infratographer.com/load-balancer-api/internal/ent/generated" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" "go.infratographer.com/load-balancer-api/internal/ent/generated/origin" "go.infratographer.com/load-balancer-api/internal/ent/generated/pool" "go.infratographer.com/load-balancer-api/internal/ent/generated/port" "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" + _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" "go.infratographer.com/load-balancer-api/pkg/metadata" + "go.infratographer.com/permissions-api/pkg/permissions" + "go.infratographer.com/x/gidx" + "golang.org/x/exp/slices" ) // LoadBalancerPoolCreate is the resolver for the LoadBalancerPoolCreate field. diff --git a/internal/graphapi/pool_test.go b/internal/graphapi/pool_test.go index a359e0606..8d1341278 100644 --- a/internal/graphapi/pool_test.go +++ b/internal/graphapi/pool_test.go @@ -68,6 +68,7 @@ func TestQueryPool(t *testing.T) { require.Error(t, err) assert.ErrorContains(t, err, tt.errorMsg) assert.Nil(t, resp) + return } @@ -161,6 +162,7 @@ func TestMutate_PoolCreate(t *testing.T) { require.Error(t, err) assert.ErrorContains(t, err, tt.errorMsg) assert.Nil(t, createdPoolResp) + return } @@ -265,6 +267,7 @@ func TestMutate_PoolUpdate(t *testing.T) { require.Error(t, err) assert.ErrorContains(t, err, tt.errorMsg) assert.Nil(t, updatedPoolResp) + return } @@ -335,6 +338,7 @@ func TestMutate_PoolDelete(t *testing.T) { require.Error(t, err) assert.Nil(t, poolDeleteResp) assert.ErrorContains(t, err, tt.errorMsg) + return } diff --git a/internal/graphapi/port.resolvers.go b/internal/graphapi/port.resolvers.go index 1724c8d80..97e421ec9 100644 --- a/internal/graphapi/port.resolvers.go +++ b/internal/graphapi/port.resolvers.go @@ -8,13 +8,13 @@ import ( "context" "strings" - "go.infratographer.com/permissions-api/pkg/permissions" - "go.infratographer.com/x/gidx" - "go.infratographer.com/load-balancer-api/internal/ent/generated" "go.infratographer.com/load-balancer-api/internal/ent/generated/pool" "go.infratographer.com/load-balancer-api/internal/ent/generated/port" + _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" "go.infratographer.com/load-balancer-api/pkg/metadata" + "go.infratographer.com/permissions-api/pkg/permissions" + "go.infratographer.com/x/gidx" ) // LoadBalancerPortCreate is the resolver for the loadBalancerPortCreate field. diff --git a/internal/graphapi/port_test.go b/internal/graphapi/port_test.go index 686f6cc91..ac8e12ee8 100644 --- a/internal/graphapi/port_test.go +++ b/internal/graphapi/port_test.go @@ -134,6 +134,7 @@ func TestCreate_LoadbalancerPort(t *testing.T) { for _, tt := range testCases { t.Run(tt.TestName, func(t *testing.T) { tt := tt + t.Parallel() resp, err := graphTestClient().LoadBalancerPortCreate(ctx, tt.Input) @@ -339,7 +340,9 @@ func TestDelete_LoadbalancerPort(t *testing.T) { for _, tt := range testCases { t.Run(tt.TestName, func(t *testing.T) { tt := tt + t.Parallel() + resp, err := graphTestClient().LoadBalancerPortDelete(ctx, tt.Input) if tt.errorMsg != "" { diff --git a/internal/graphapi/provider.resolvers.go b/internal/graphapi/provider.resolvers.go index 5f98234b9..8f5bd93b6 100644 --- a/internal/graphapi/provider.resolvers.go +++ b/internal/graphapi/provider.resolvers.go @@ -8,6 +8,7 @@ import ( "context" "go.infratographer.com/load-balancer-api/internal/ent/generated" + _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" "go.infratographer.com/permissions-api/pkg/permissions" "go.infratographer.com/x/gidx" ) diff --git a/internal/graphapi/provider_test.go b/internal/graphapi/provider_test.go index 1d88f4b9d..a0df85edc 100644 --- a/internal/graphapi/provider_test.go +++ b/internal/graphapi/provider_test.go @@ -55,6 +55,7 @@ func TestQuery_loadBalancerProvider(t *testing.T) { for _, tt := range testCases { t.Run(tt.TestName, func(t *testing.T) { tt := tt + t.Parallel() resp, err := graphTestClient().GetLoadBalancerProvider(ctx, tt.QueryID) @@ -118,6 +119,7 @@ func TestCreate_Provider(t *testing.T) { for _, tt := range testCases { t.Run(tt.TestName, func(t *testing.T) { tt := tt + t.Parallel() resp, err := graphTestClient().LoadBalancerProviderCreate(ctx, tt.Input) diff --git a/internal/graphclient/gen_models.go b/internal/graphclient/gen_models.go index f05f180d9..8e8f20258 100644 --- a/internal/graphclient/gen_models.go +++ b/internal/graphclient/gen_models.go @@ -88,6 +88,8 @@ type LoadBalancer struct { ID gidx.PrefixedID `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` // The name of the load balancer. Name string `json:"name"` Ports LoadBalancerPortConnection `json:"ports"` @@ -152,6 +154,8 @@ type LoadBalancerOrigin struct { ID gidx.PrefixedID `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` Name string `json:"name"` Weight int64 `json:"weight"` Target string `json:"target"` @@ -245,6 +249,38 @@ type LoadBalancerOriginWhereInput struct { UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` // name field predicates Name *string `json:"name,omitempty"` NameNeq *string `json:"nameNEQ,omitempty"` @@ -303,6 +339,8 @@ type LoadBalancerPool struct { ID gidx.PrefixedID `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` Name string `json:"name"` Protocol LoadBalancerPoolProtocol `json:"protocol"` OwnerID gidx.PrefixedID `json:"ownerID"` @@ -396,6 +434,38 @@ type LoadBalancerPoolWhereInput struct { UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` // name field predicates Name *string `json:"name,omitempty"` NameNeq *string `json:"nameNEQ,omitempty"` @@ -427,6 +497,8 @@ type LoadBalancerPort struct { ID gidx.PrefixedID `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` Number int64 `json:"number"` Name string `json:"name"` LoadBalancerID gidx.PrefixedID `json:"loadBalancerID"` @@ -518,6 +590,38 @@ type LoadBalancerPortWhereInput struct { UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` // number field predicates Number *int64 `json:"number,omitempty"` NumberNeq *int64 `json:"numberNEQ,omitempty"` @@ -554,6 +658,8 @@ type LoadBalancerProvider struct { ID gidx.PrefixedID `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` // The name of the load balancer provider. Name string `json:"name"` LoadBalancers LoadBalancerConnection `json:"loadBalancers"` @@ -645,6 +751,38 @@ type LoadBalancerProviderWhereInput struct { UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` // name field predicates Name *string `json:"name,omitempty"` NameNeq *string `json:"nameNEQ,omitempty"` @@ -703,6 +841,38 @@ type LoadBalancerWhereInput struct { UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` // name field predicates Name *string `json:"name,omitempty"` NameNeq *string `json:"nameNEQ,omitempty"` @@ -813,6 +983,8 @@ const ( LoadBalancerOrderFieldID LoadBalancerOrderField = "ID" LoadBalancerOrderFieldCreatedAt LoadBalancerOrderField = "CREATED_AT" LoadBalancerOrderFieldUpdatedAt LoadBalancerOrderField = "UPDATED_AT" + LoadBalancerOrderFieldCreatedBy LoadBalancerOrderField = "CREATED_BY" + LoadBalancerOrderFieldUpdatedBy LoadBalancerOrderField = "UPDATED_BY" LoadBalancerOrderFieldName LoadBalancerOrderField = "NAME" LoadBalancerOrderFieldOwner LoadBalancerOrderField = "OWNER" ) @@ -821,13 +993,15 @@ var AllLoadBalancerOrderField = []LoadBalancerOrderField{ LoadBalancerOrderFieldID, LoadBalancerOrderFieldCreatedAt, LoadBalancerOrderFieldUpdatedAt, + LoadBalancerOrderFieldCreatedBy, + LoadBalancerOrderFieldUpdatedBy, LoadBalancerOrderFieldName, LoadBalancerOrderFieldOwner, } func (e LoadBalancerOrderField) IsValid() bool { switch e { - case LoadBalancerOrderFieldID, LoadBalancerOrderFieldCreatedAt, LoadBalancerOrderFieldUpdatedAt, LoadBalancerOrderFieldName, LoadBalancerOrderFieldOwner: + case LoadBalancerOrderFieldID, LoadBalancerOrderFieldCreatedAt, LoadBalancerOrderFieldUpdatedAt, LoadBalancerOrderFieldCreatedBy, LoadBalancerOrderFieldUpdatedBy, LoadBalancerOrderFieldName, LoadBalancerOrderFieldOwner: return true } return false @@ -860,6 +1034,8 @@ type LoadBalancerOriginOrderField string const ( LoadBalancerOriginOrderFieldCreatedAt LoadBalancerOriginOrderField = "CREATED_AT" LoadBalancerOriginOrderFieldUpdatedAt LoadBalancerOriginOrderField = "UPDATED_AT" + LoadBalancerOriginOrderFieldCreatedBy LoadBalancerOriginOrderField = "CREATED_BY" + LoadBalancerOriginOrderFieldUpdatedBy LoadBalancerOriginOrderField = "UPDATED_BY" LoadBalancerOriginOrderFieldName LoadBalancerOriginOrderField = "name" LoadBalancerOriginOrderFieldWeight LoadBalancerOriginOrderField = "weight" LoadBalancerOriginOrderFieldTarget LoadBalancerOriginOrderField = "target" @@ -870,6 +1046,8 @@ const ( var AllLoadBalancerOriginOrderField = []LoadBalancerOriginOrderField{ LoadBalancerOriginOrderFieldCreatedAt, LoadBalancerOriginOrderFieldUpdatedAt, + LoadBalancerOriginOrderFieldCreatedBy, + LoadBalancerOriginOrderFieldUpdatedBy, LoadBalancerOriginOrderFieldName, LoadBalancerOriginOrderFieldWeight, LoadBalancerOriginOrderFieldTarget, @@ -879,7 +1057,7 @@ var AllLoadBalancerOriginOrderField = []LoadBalancerOriginOrderField{ func (e LoadBalancerOriginOrderField) IsValid() bool { switch e { - case LoadBalancerOriginOrderFieldCreatedAt, LoadBalancerOriginOrderFieldUpdatedAt, LoadBalancerOriginOrderFieldName, LoadBalancerOriginOrderFieldWeight, LoadBalancerOriginOrderFieldTarget, LoadBalancerOriginOrderFieldNumber, LoadBalancerOriginOrderFieldActive: + case LoadBalancerOriginOrderFieldCreatedAt, LoadBalancerOriginOrderFieldUpdatedAt, LoadBalancerOriginOrderFieldCreatedBy, LoadBalancerOriginOrderFieldUpdatedBy, LoadBalancerOriginOrderFieldName, LoadBalancerOriginOrderFieldWeight, LoadBalancerOriginOrderFieldTarget, LoadBalancerOriginOrderFieldNumber, LoadBalancerOriginOrderFieldActive: return true } return false @@ -912,6 +1090,8 @@ type LoadBalancerPoolOrderField string const ( LoadBalancerPoolOrderFieldCreatedAt LoadBalancerPoolOrderField = "CREATED_AT" LoadBalancerPoolOrderFieldUpdatedAt LoadBalancerPoolOrderField = "UPDATED_AT" + LoadBalancerPoolOrderFieldCreatedBy LoadBalancerPoolOrderField = "CREATED_BY" + LoadBalancerPoolOrderFieldUpdatedBy LoadBalancerPoolOrderField = "UPDATED_BY" LoadBalancerPoolOrderFieldName LoadBalancerPoolOrderField = "name" LoadBalancerPoolOrderFieldProtocol LoadBalancerPoolOrderField = "protocol" ) @@ -919,13 +1099,15 @@ const ( var AllLoadBalancerPoolOrderField = []LoadBalancerPoolOrderField{ LoadBalancerPoolOrderFieldCreatedAt, LoadBalancerPoolOrderFieldUpdatedAt, + LoadBalancerPoolOrderFieldCreatedBy, + LoadBalancerPoolOrderFieldUpdatedBy, LoadBalancerPoolOrderFieldName, LoadBalancerPoolOrderFieldProtocol, } func (e LoadBalancerPoolOrderField) IsValid() bool { switch e { - case LoadBalancerPoolOrderFieldCreatedAt, LoadBalancerPoolOrderFieldUpdatedAt, LoadBalancerPoolOrderFieldName, LoadBalancerPoolOrderFieldProtocol: + case LoadBalancerPoolOrderFieldCreatedAt, LoadBalancerPoolOrderFieldUpdatedAt, LoadBalancerPoolOrderFieldCreatedBy, LoadBalancerPoolOrderFieldUpdatedBy, LoadBalancerPoolOrderFieldName, LoadBalancerPoolOrderFieldProtocol: return true } return false @@ -1000,6 +1182,8 @@ type LoadBalancerPortOrderField string const ( LoadBalancerPortOrderFieldCreatedAt LoadBalancerPortOrderField = "CREATED_AT" LoadBalancerPortOrderFieldUpdatedAt LoadBalancerPortOrderField = "UPDATED_AT" + LoadBalancerPortOrderFieldCreatedBy LoadBalancerPortOrderField = "CREATED_BY" + LoadBalancerPortOrderFieldUpdatedBy LoadBalancerPortOrderField = "UPDATED_BY" LoadBalancerPortOrderFieldNumber LoadBalancerPortOrderField = "number" LoadBalancerPortOrderFieldName LoadBalancerPortOrderField = "name" ) @@ -1007,13 +1191,15 @@ const ( var AllLoadBalancerPortOrderField = []LoadBalancerPortOrderField{ LoadBalancerPortOrderFieldCreatedAt, LoadBalancerPortOrderFieldUpdatedAt, + LoadBalancerPortOrderFieldCreatedBy, + LoadBalancerPortOrderFieldUpdatedBy, LoadBalancerPortOrderFieldNumber, LoadBalancerPortOrderFieldName, } func (e LoadBalancerPortOrderField) IsValid() bool { switch e { - case LoadBalancerPortOrderFieldCreatedAt, LoadBalancerPortOrderFieldUpdatedAt, LoadBalancerPortOrderFieldNumber, LoadBalancerPortOrderFieldName: + case LoadBalancerPortOrderFieldCreatedAt, LoadBalancerPortOrderFieldUpdatedAt, LoadBalancerPortOrderFieldCreatedBy, LoadBalancerPortOrderFieldUpdatedBy, LoadBalancerPortOrderFieldNumber, LoadBalancerPortOrderFieldName: return true } return false @@ -1047,6 +1233,8 @@ const ( LoadBalancerProviderOrderFieldID LoadBalancerProviderOrderField = "ID" LoadBalancerProviderOrderFieldCreatedAt LoadBalancerProviderOrderField = "CREATED_AT" LoadBalancerProviderOrderFieldUpdatedAt LoadBalancerProviderOrderField = "UPDATED_AT" + LoadBalancerProviderOrderFieldCreatedBy LoadBalancerProviderOrderField = "CREATED_BY" + LoadBalancerProviderOrderFieldUpdatedBy LoadBalancerProviderOrderField = "UPDATED_BY" LoadBalancerProviderOrderFieldName LoadBalancerProviderOrderField = "NAME" LoadBalancerProviderOrderFieldOwner LoadBalancerProviderOrderField = "OWNER" ) @@ -1055,13 +1243,15 @@ var AllLoadBalancerProviderOrderField = []LoadBalancerProviderOrderField{ LoadBalancerProviderOrderFieldID, LoadBalancerProviderOrderFieldCreatedAt, LoadBalancerProviderOrderFieldUpdatedAt, + LoadBalancerProviderOrderFieldCreatedBy, + LoadBalancerProviderOrderFieldUpdatedBy, LoadBalancerProviderOrderFieldName, LoadBalancerProviderOrderFieldOwner, } func (e LoadBalancerProviderOrderField) IsValid() bool { switch e { - case LoadBalancerProviderOrderFieldID, LoadBalancerProviderOrderFieldCreatedAt, LoadBalancerProviderOrderFieldUpdatedAt, LoadBalancerProviderOrderFieldName, LoadBalancerProviderOrderFieldOwner: + case LoadBalancerProviderOrderFieldID, LoadBalancerProviderOrderFieldCreatedAt, LoadBalancerProviderOrderFieldUpdatedAt, LoadBalancerProviderOrderFieldCreatedBy, LoadBalancerProviderOrderFieldUpdatedBy, LoadBalancerProviderOrderFieldName, LoadBalancerProviderOrderFieldOwner: return true } return false diff --git a/internal/graphclient/schema/schema.graphql b/internal/graphclient/schema/schema.graphql index 654c61ad1..95c967fe5 100644 --- a/internal/graphclient/schema/schema.graphql +++ b/internal/graphclient/schema/schema.graphql @@ -78,6 +78,8 @@ type LoadBalancer implements Node & IPAddressable & MetadataNode @key(fields: "i id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String """The name of the load balancer.""" name: String! ports( @@ -144,6 +146,8 @@ enum LoadBalancerOrderField { ID CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY NAME OWNER } @@ -151,6 +155,8 @@ type LoadBalancerOrigin implements Node @key(fields: "id") @prefixedID(prefix: " id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String name: String! weight: Int! target: String! @@ -196,6 +202,8 @@ input LoadBalancerOriginOrder { enum LoadBalancerOriginOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY name weight target @@ -242,6 +250,38 @@ input LoadBalancerOriginWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -299,6 +339,8 @@ type LoadBalancerPool implements Node @key(fields: "id") @prefixedID(prefix: "lo id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String name: String! protocol: LoadBalancerPoolProtocol! ownerID: ID! @@ -362,6 +404,8 @@ input LoadBalancerPoolOrder { enum LoadBalancerPoolOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY name protocol } @@ -410,6 +454,38 @@ input LoadBalancerPoolWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -440,6 +516,8 @@ type LoadBalancerPort implements Node @key(fields: "id") @prefixedID(prefix: "lo id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String number: Int! name: String! loadBalancerID: ID! @@ -483,6 +561,8 @@ input LoadBalancerPortOrder { enum LoadBalancerPortOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY number name } @@ -526,6 +606,38 @@ input LoadBalancerPortWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """number field predicates""" number: Int numberNEQ: Int @@ -561,6 +673,8 @@ type LoadBalancerProvider implements Node @key(fields: "id") @prefixedID(prefix: id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String """The name of the load balancer provider.""" name: String! loadBalancers( @@ -623,6 +737,8 @@ enum LoadBalancerProviderOrderField { ID CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY NAME OWNER } @@ -666,6 +782,38 @@ input LoadBalancerProviderWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -724,6 +872,38 @@ input LoadBalancerWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String diff --git a/internal/manualhooks/hooks.go b/internal/manualhooks/hooks.go index 1bd12cc23..34dce887b 100644 --- a/internal/manualhooks/hooks.go +++ b/internal/manualhooks/hooks.go @@ -18,6 +18,8 @@ import ( "go.infratographer.com/load-balancer-api/internal/ent/generated/pool" "go.infratographer.com/load-balancer-api/internal/ent/generated/port" "go.infratographer.com/load-balancer-api/internal/ent/schema" + + _ "go.infratographer.com/load-balancer-api/internal/ent/generated/runtime" ) func LoadBalancerHooks() []ent.Hook { diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index a6e11e5e2..85e568cf2 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -281,6 +281,7 @@ func mustNewGQLTestClient(respJSON string, respCode int) *graphql.Client { w.WriteHeader(respCode) w.Header().Set("Content-Type", "application/json") _, err := io.WriteString(w, respJSON) + if err != nil { panic(err) } diff --git a/schema.graphql b/schema.graphql index 8fef4e101..dbcd38662 100644 --- a/schema.graphql +++ b/schema.graphql @@ -65,6 +65,8 @@ type LoadBalancer implements Node & IPAddressable & MetadataNode @key(fields: "i id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String """The name of the load balancer.""" name: String! ports( @@ -131,6 +133,8 @@ enum LoadBalancerOrderField { ID CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY NAME OWNER } @@ -138,6 +142,8 @@ type LoadBalancerOrigin implements Node @key(fields: "id") @prefixedID(prefix: " id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String name: String! weight: Int! target: String! @@ -183,6 +189,8 @@ input LoadBalancerOriginOrder { enum LoadBalancerOriginOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY name weight target @@ -229,6 +237,38 @@ input LoadBalancerOriginWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -286,6 +326,8 @@ type LoadBalancerPool implements Node @key(fields: "id") @prefixedID(prefix: "lo id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String name: String! protocol: LoadBalancerPoolProtocol! ownerID: ID! @@ -349,6 +391,8 @@ input LoadBalancerPoolOrder { enum LoadBalancerPoolOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY name protocol } @@ -397,6 +441,38 @@ input LoadBalancerPoolWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -427,6 +503,8 @@ type LoadBalancerPort implements Node @key(fields: "id") @prefixedID(prefix: "lo id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String number: Int! name: String! loadBalancerID: ID! @@ -470,6 +548,8 @@ input LoadBalancerPortOrder { enum LoadBalancerPortOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY number name } @@ -513,6 +593,38 @@ input LoadBalancerPortWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """number field predicates""" number: Int numberNEQ: Int @@ -548,6 +660,8 @@ type LoadBalancerProvider implements Node @key(fields: "id") @prefixedID(prefix: id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String """The name of the load balancer provider.""" name: String! loadBalancers( @@ -610,6 +724,8 @@ enum LoadBalancerProviderOrderField { ID CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY NAME OWNER } @@ -653,6 +769,38 @@ input LoadBalancerProviderWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -711,6 +859,38 @@ input LoadBalancerWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String diff --git a/schema/ent.graphql b/schema/ent.graphql index 29c303ef2..9607f0ff1 100644 --- a/schema/ent.graphql +++ b/schema/ent.graphql @@ -63,6 +63,8 @@ type LoadBalancer implements Node & IPAddressable & MetadataNode @key(fields: "i id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String """The name of the load balancer.""" name: String! ports( @@ -115,6 +117,8 @@ enum LoadBalancerOrderField { ID CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY NAME OWNER } @@ -122,6 +126,8 @@ type LoadBalancerOrigin implements Node @key(fields: "id") @prefixedID(prefix: " id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String name: String! weight: Int! target: String! @@ -157,6 +163,8 @@ input LoadBalancerOriginOrder { enum LoadBalancerOriginOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY name weight target @@ -198,6 +206,38 @@ input LoadBalancerOriginWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -255,6 +295,8 @@ type LoadBalancerPool implements Node @key(fields: "id") @prefixedID(prefix: "lo id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String name: String! protocol: LoadBalancerPoolProtocol! ownerID: ID! @@ -306,6 +348,8 @@ input LoadBalancerPoolOrder { enum LoadBalancerPoolOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY name protocol } @@ -349,6 +393,38 @@ input LoadBalancerPoolWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -379,6 +455,8 @@ type LoadBalancerPort implements Node @key(fields: "id") @prefixedID(prefix: "lo id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String number: Int! name: String! loadBalancerID: ID! @@ -412,6 +490,8 @@ input LoadBalancerPortOrder { enum LoadBalancerPortOrderField { CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY number name } @@ -450,6 +530,38 @@ input LoadBalancerPortWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """number field predicates""" number: Int numberNEQ: Int @@ -485,6 +597,8 @@ type LoadBalancerProvider implements Node @key(fields: "id") @prefixedID(prefix: id: ID! createdAt: Time! updatedAt: Time! + createdBy: String + updatedBy: String """The name of the load balancer provider.""" name: String! loadBalancers( @@ -535,6 +649,8 @@ enum LoadBalancerProviderOrderField { ID CREATED_AT UPDATED_AT + CREATED_BY + UPDATED_BY NAME OWNER } @@ -573,6 +689,38 @@ input LoadBalancerProviderWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String @@ -626,6 +774,38 @@ input LoadBalancerWhereInput { updatedAtGTE: Time updatedAtLT: Time updatedAtLTE: Time + """created_by field predicates""" + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """updated_by field predicates""" + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String """name field predicates""" name: String nameNEQ: String