diff --git a/.github/workflows/apollo-studio-publish.yml b/.github/workflows/apollo-studio-publish.yml new file mode 100644 index 000000000..192d1cf58 --- /dev/null +++ b/.github/workflows/apollo-studio-publish.yml @@ -0,0 +1,22 @@ +name: Publish GraphQL Schema +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + env: + APOLLO_KEY: ${{ secrets.APOLLO_KEY }} + APOLLO_VCS_COMMIT: ${{ github.event.pull_request.head.sha }} + steps: + - uses: actions/checkout@v3 + + - name: Install Rover + run: | + curl -sSL https://rover.apollo.dev/nix/latest | sh + echo "$HOME/.rover/bin" >> $GITHUB_PATH + - name: Publish subgraph schema + run: | + rover subgraph publish --name load-balancer-api --schema schema.graphql infratographer@main diff --git a/db/migrations/20230629085916_drop_status_and_annotations.sql b/db/migrations/20230629085916_drop_status_and_annotations.sql new file mode 100644 index 000000000..dca39f586 --- /dev/null +++ b/db/migrations/20230629085916_drop_status_and_annotations.sql @@ -0,0 +1,52 @@ +-- +goose Up + +-- reverse: create index "loadbalancerstatus_created_at" to table: "load_balancer_status" +DROP INDEX "loadbalancerstatus_created_at"; +-- reverse: create index "loadbalancerstatus_load_balancer_id" to table: "load_balancer_status" +DROP INDEX "loadbalancerstatus_load_balancer_id"; +-- reverse: create index "loadbalancerstatus_load_balancer_id_namespace_source" to table: "load_balancer_status" +DROP INDEX "loadbalancerstatus_load_balancer_id_namespace_source"; +-- reverse: create index "loadbalancerstatus_namespace_data" to table: "load_balancer_status" +DROP INDEX "loadbalancerstatus_namespace_data"; +-- reverse: create index "loadbalancerstatus_updated_at" to table: "load_balancer_status" +DROP INDEX "loadbalancerstatus_updated_at"; +-- reverse: create "load_balancer_status" table +DROP TABLE "load_balancer_status"; +-- reverse: create index "loadbalancerannotation_created_at" to table: "load_balancer_annotations" +DROP INDEX "loadbalancerannotation_created_at"; +-- reverse: create index "loadbalancerannotation_load_balancer_id" to table: "load_balancer_annotations" +DROP INDEX "loadbalancerannotation_load_balancer_id"; +-- reverse: create index "loadbalancerannotation_load_balancer_id_namespace" to table: "load_balancer_annotations" +DROP INDEX "loadbalancerannotation_load_balancer_id_namespace"; +-- reverse: create index "loadbalancerannotation_namespace_data" to table: "load_balancer_annotations" +DROP INDEX "loadbalancerannotation_namespace_data"; +-- reverse: create index "loadbalancerannotation_updated_at" to table: "load_balancer_annotations" +DROP INDEX "loadbalancerannotation_updated_at"; +-- reverse: create "load_balancer_annotations" table +DROP TABLE "load_balancer_annotations"; + +-- +goose Down +-- create "load_balancer_annotations" table +CREATE TABLE "load_balancer_annotations" ("id" character varying NOT NULL, "namespace" character varying NOT NULL, "data" jsonb NOT NULL, "created_at" timestamptz NOT NULL, "updated_at" timestamptz NOT NULL, "load_balancer_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "load_balancer_annotations_load_balancers_load_balancer" FOREIGN KEY ("load_balancer_id") REFERENCES "load_balancers" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- create index "loadbalancerannotation_created_at" to table: "load_balancer_annotations" +CREATE INDEX "loadbalancerannotation_created_at" ON "load_balancer_annotations" ("created_at"); +-- create index "loadbalancerannotation_load_balancer_id" to table: "load_balancer_annotations" +CREATE INDEX "loadbalancerannotation_load_balancer_id" ON "load_balancer_annotations" ("load_balancer_id"); +-- create index "loadbalancerannotation_load_balancer_id_namespace" to table: "load_balancer_annotations" +CREATE INDEX "loadbalancerannotation_load_balancer_id_namespace" ON "load_balancer_annotations" ("load_balancer_id", "namespace"); +-- create index "loadbalancerannotation_namespace_data" to table: "load_balancer_annotations" +CREATE INDEX "loadbalancerannotation_namespace_data" ON "load_balancer_annotations" USING gin ("namespace", "data"); +-- create index "loadbalancerannotation_updated_at" to table: "load_balancer_annotations" +CREATE INDEX "loadbalancerannotation_updated_at" ON "load_balancer_annotations" ("updated_at"); +-- create "load_balancer_status" table +CREATE TABLE "load_balancer_status" ("id" character varying NOT NULL, "namespace" character varying NOT NULL, "data" jsonb NOT NULL, "created_at" timestamptz NOT NULL, "updated_at" timestamptz NOT NULL, "source" character varying NOT NULL, "load_balancer_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "load_balancer_status_load_balancers_load_balancer" FOREIGN KEY ("load_balancer_id") REFERENCES "load_balancers" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- create index "loadbalancerstatus_created_at" to table: "load_balancer_status" +CREATE INDEX "loadbalancerstatus_created_at" ON "load_balancer_status" ("created_at"); +-- create index "loadbalancerstatus_load_balancer_id" to table: "load_balancer_status" +CREATE INDEX "loadbalancerstatus_load_balancer_id" ON "load_balancer_status" ("load_balancer_id"); +-- create index "loadbalancerstatus_load_balancer_id_namespace_source" to table: "load_balancer_status" +CREATE INDEX "loadbalancerstatus_load_balancer_id_namespace_source" ON "load_balancer_status" ("load_balancer_id", "namespace", "source"); +-- create index "loadbalancerstatus_namespace_data" to table: "load_balancer_status" +CREATE INDEX "loadbalancerstatus_namespace_data" ON "load_balancer_status" USING gin ("namespace", "data"); +-- create index "loadbalancerstatus_updated_at" to table: "load_balancer_status" +CREATE INDEX "loadbalancerstatus_updated_at" ON "load_balancer_status" ("updated_at"); diff --git a/db/migrations/atlas.sum b/db/migrations/atlas.sum index dd7898892..fbb7f23ed 100644 --- a/db/migrations/atlas.sum +++ b/db/migrations/atlas.sum @@ -1,3 +1,4 @@ -h1:VqR1OSr9cOmG9cPyGgjEbDiQxwCpFRLGNlYKzYjpMZc= +h1:c+ziReSuevRk7RBOpYWo0gncdcwco4V61ROlPMPe5EE= 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= diff --git a/gen_schema.go b/gen_schema.go index 94ec76d40..15b6ffcdc 100644 --- a/gen_schema.go +++ b/gen_schema.go @@ -1,3 +1,17 @@ +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //go:build ignore package main @@ -6,6 +20,7 @@ import ( "log" "os" + "github.com/vektah/gqlparser/v2/ast" "github.com/vektah/gqlparser/v2/formatter" "go.infratographer.com/load-balancer-api/internal/graphapi" @@ -16,49 +31,85 @@ func main() { execSchema := graphapi.NewExecutableSchema(graphapi.Config{}) schema := execSchema.Schema() + // remove codegen directives that we don't want in published schema + for _, t := range schema.Types { + dirs := ast.DirectiveList{} + for _, td := range t.Directives { + switch td.Name { + case "goField", "goModel": + continue + default: + dirs = append(dirs, td) + } + } + t.Directives = dirs + + for _, f := range t.Fields { + dirs := ast.DirectiveList{} + for _, fd := range f.Directives { + switch fd.Name { + case "goField", "goModel": + continue + default: + dirs = append(dirs, fd) + } + } + f.Directives = dirs + } + } + + delete(schema.Directives, "goField") + delete(schema.Directives, "goModel") + // Some of our federation fields get marked as "BuiltIn" by gengql and the formatter doesn't print builtin types, this adds them for us. - entities := schema.Types["_Entity"] - entities.BuiltIn = false - service := schema.Types["_Service"] - service.BuiltIn = false - // entities.Position.Src.BuiltIn = false + entityType := schema.Types["_Entity"] + entityType.BuiltIn = false + serviceType := schema.Types["_Service"] + serviceType.BuiltIn = false + anyType := schema.Types["_Any"] + anyType.BuiltIn = false f, err := os.Create("schema.graphql") if err != nil { log.Fatal(err) } defer f.Close() - fmtr := formatter.NewFormatter(f) + fmtr := formatter.NewFormatter(f) fmtr.FormatSchema(schema) f.Write(federationSchema) + + // Write testclient schema, include all federation params + // find the internal federation src and mark it as not builtin. "interfaceObject" is a federation directive, + // so we use that to look up the source + intObj := schema.Directives["interfaceObject"] + intObj.Position.Src.BuiltIn = false + schema.Types["FieldSet"].BuiltIn = false + + clientSchema, err := os.Create("internal/graphclient/schema/schema.graphql") + if err != nil { + log.Fatal(err) + } + defer clientSchema.Close() + + fmtr = formatter.NewFormatter(clientSchema) + fmtr.FormatSchema(schema) } -var federationSchema = []byte(`scalar _Any -scalar FieldSet -directive @requires(fields: FieldSet!) on FIELD_DEFINITION -directive @provides(fields: FieldSet!) on FIELD_DEFINITION -directive @extends on OBJECT | INTERFACE -directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE -directive @link(import: [String!], url: String!) repeatable on SCHEMA -directive @external on FIELD_DEFINITION | OBJECT -directive @shareable on OBJECT | FIELD_DEFINITION -directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION -directive @override(from: String!) on FIELD_DEFINITION -directive @inaccessible on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION -#directive @interfaceObject on OBJECT +var federationSchema = []byte(` extend schema @link( - url: "https://specs.apollo.dev/federation/v2.3" - import: [ - "@key", - "@external", - "@shareable", - "@tag", - "@override", - "@inaccessible", - "@interfaceObject" - ] + url: "https://specs.apollo.dev/federation/v2.3" + import: [ + "@key", + "@interfaceObject", + "@shareable", + "@inaccessible", + "@override", + "@provides", + "@requires", + "@tag" + ] ) `) diff --git a/go.mod b/go.mod index 4430369e3..593b921d5 100644 --- a/go.mod +++ b/go.mod @@ -2,14 +2,12 @@ module go.infratographer.com/load-balancer-api go 1.20 -replace github.com/testcontainers/testcontainers-go => github.com/testcontainers/testcontainers-go v0.0.0-20230503220718-0df60de8ccd8 - require ( entgo.io/contrib v0.4.5 entgo.io/ent v0.12.4-0.20230503082810-f251400818ea - github.com/99designs/gqlgen v0.17.31 - github.com/Yamashou/gqlgenc v0.13.5 - github.com/brianvoe/gofakeit/v6 v6.21.0 + github.com/99designs/gqlgen v0.17.34 + github.com/Yamashou/gqlgenc v0.14.0 + github.com/brianvoe/gofakeit/v6 v6.22.0 github.com/docker/go-connections v0.4.0 github.com/hashicorp/go-multierror v1.1.1 github.com/labstack/echo/v4 v4.10.2 @@ -20,9 +18,9 @@ require ( github.com/spf13/cobra v1.7.0 github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.20.1 - github.com/testcontainers/testcontainers-go/modules/postgres v0.20.1 - github.com/vektah/gqlparser/v2 v2.5.1 + github.com/testcontainers/testcontainers-go v0.21.0 + github.com/testcontainers/testcontainers-go/modules/postgres v0.21.0 + github.com/vektah/gqlparser/v2 v2.5.6 github.com/wundergraph/graphql-go-tools v1.62.3 go.infratographer.com/permissions-api v0.1.11 go.infratographer.com/x v0.3.2 @@ -68,7 +66,7 @@ require ( github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/hcl/v2 v2.13.0 // indirect github.com/imdario/mergo v0.3.15 // indirect diff --git a/go.sum b/go.sum index e41ddfa90..53b1180a6 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,8 @@ entgo.io/ent v0.12.4-0.20230503082810-f251400818ea h1:R0Rq0neRfHnux+a4NrCgNncloO entgo.io/ent v0.12.4-0.20230503082810-f251400818ea/go.mod h1:+x2PEyfSrFBxxCwurJWZAVUUAVcxYn6hXIWHQ2es11g= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -github.com/99designs/gqlgen v0.17.31 h1:VncSQ82VxieHkea8tz11p7h/zSbvHSxSDZfywqWt158= -github.com/99designs/gqlgen v0.17.31/go.mod h1:i4rEatMrzzu6RXaHydq1nmEPZkb3bKQsnxNRHS4DQB4= +github.com/99designs/gqlgen v0.17.34 h1:5cS5/OKFguQt+Ws56uj9FlG2xm1IlcJWNF2jrMIKYFQ= +github.com/99designs/gqlgen v0.17.34/go.mod h1:Axcd3jIFHBVcqzixujJQr1wGqE+lGTpz6u4iZBZg1G8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -63,11 +63,10 @@ github.com/ThreeDotsLabs/watermill-nats/v2 v2.0.0 h1:ZbdQ+cHwOZmXByEoKUH8SS6qR/e github.com/ThreeDotsLabs/watermill-nats/v2 v2.0.0/go.mod h1:X6pcl579pScj4mII3KM/WJ+bcOqORqiCToy92f4gqJ4= github.com/XSAM/otelsql v0.23.0 h1:NsJQS9YhI1+RDsFqE9mW5XIQmPmdF/qa8qQOLZN8XEA= github.com/XSAM/otelsql v0.23.0/go.mod h1:oX4LXMsb+9lAZhvHjUS61oQP/hbcJRadWHnBKNL+LuM= -github.com/Yamashou/gqlgenc v0.13.5 h1:aBv3D6pgY8ZXr6ArYHMtTkggui8eQVgjhgDaGnNbkxk= -github.com/Yamashou/gqlgenc v0.13.5/go.mod h1:+z+FRCtGrNmgTxweAUiCodOmQJLTCNtnRNAqhewf1Q8= +github.com/Yamashou/gqlgenc v0.14.0 h1:KVzUuVQKfl4Phm5Cw4yeFThDAxZoIBR9XLoK/4O1O6U= +github.com/Yamashou/gqlgenc v0.14.0/go.mod h1:+z+FRCtGrNmgTxweAUiCodOmQJLTCNtnRNAqhewf1Q8= github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= @@ -79,8 +78,8 @@ github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdK github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/brianvoe/gofakeit/v6 v6.21.0 h1:tNkm9yxEbpuPK8Bx39tT4sSc5i9SUGiciLdNix+VDQY= -github.com/brianvoe/gofakeit/v6 v6.21.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8= +github.com/brianvoe/gofakeit/v6 v6.22.0 h1:BzOsDot1o3cufTfOk+fWKE9nFYojyDV+XHdCWL2+uyE= +github.com/brianvoe/gofakeit/v6 v6.22.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -105,6 +104,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.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/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= @@ -232,8 +232,8 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4= -github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/golang-lru/v2 v2.0.3 h1:kmRrRLlInXvng0SmLxmQpQkpbYAvcXm7NPDrgxJa9mE= +github.com/hashicorp/golang-lru/v2 v2.0.3/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.13.0 h1:0Apadu1w6M11dyGFxWnmhhcMjkbAiKCv7G1r/2QgCNc= @@ -409,11 +409,13 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR 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/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= @@ -454,17 +456,19 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/testcontainers/testcontainers-go v0.0.0-20230503220718-0df60de8ccd8 h1:atmQux3l6blXSWP4HA4UiUO0VASfsLQr5A1uRtDdg/A= -github.com/testcontainers/testcontainers-go v0.0.0-20230503220718-0df60de8ccd8/go.mod h1:LTa6q4eygL67Y8LvAmjaUGIiFZlZ+VYvHOWjXLWP8Vg= -github.com/testcontainers/testcontainers-go/modules/postgres v0.20.1 h1:PkAq2/sxchYxLiepcshIUnMzmhlecakGOCTtKEuZCA0= -github.com/testcontainers/testcontainers-go/modules/postgres v0.20.1/go.mod h1:c9mDiyvz7se25wEvvkx/8ok1YIIsQE9ACItnim7C0xw= +github.com/testcontainers/testcontainers-go v0.21.0 h1:syePAxdeTzfkap+RrJaQZpJQ/s/fsUgn11xIvHrOE9U= +github.com/testcontainers/testcontainers-go v0.21.0/go.mod h1:c1ez3WVRHq7T/Aj+X3TIipFBwkBaNT5iNCY8+1b83Ng= +github.com/testcontainers/testcontainers-go/modules/postgres v0.21.0 h1:rFPyTR7pPMiHcDktXwd5iZ+mA1cHH/WRa+knxBcY8wU= +github.com/testcontainers/testcontainers-go/modules/postgres v0.21.0/go.mod h1:Uoia8PX1RewxkJTbeXGBK6vgMjlmRbnL/4n0EXH2Z54= +github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= +github.com/urfave/cli/v2 v2.25.5 h1:d0NIAyhh5shGscroL7ek/Ya9QYQE0KNabJgiUinIQkc= 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.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/vektah/gqlparser/v2 v2.5.1 h1:ZGu+bquAY23jsxDRcYpWjttRZrUz07LbiY77gUOHcr4= -github.com/vektah/gqlparser/v2 v2.5.1/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRFZrvOnp3hmCs= +github.com/vektah/gqlparser/v2 v2.5.6 h1:Ou14T0N1s191eRMZ1gARVqohcbe1e8FrcONScsq8cRU= +github.com/vektah/gqlparser/v2 v2.5.6/go.mod h1:z8xXUff237NntSuH8mLFijZ+1tjV1swDbpDqjJmk6ME= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/msgpack/v5 v5.0.0-beta.9 h1:iBRIniTnWOo0kqkg3k3XR8Vn6OCkVlIuZNo0UoBrKx4= github.com/vmihailenco/msgpack/v5 v5.0.0-beta.9/go.mod h1:HVxBVPUK/+fZMonk4bi1islLa8V3cfnBug0+4dykPzo= @@ -473,6 +477,7 @@ github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vb github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/wundergraph/graphql-go-tools v1.62.3 h1:WKpkhKqWoTq/AE0AbrZ+66ezUe3l/wAqZZurZeL5qqQ= github.com/wundergraph/graphql-go-tools v1.62.3/go.mod h1:Lsg/b4nVfNQLyJE1mjPV73O/JuhhCxH5qmaWQjitVHM= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -904,9 +909,8 @@ gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/gqlgenc.yml b/gqlgenc.yml index 151e37c49..a4e15e281 100644 --- a/gqlgenc.yml +++ b/gqlgenc.yml @@ -15,8 +15,8 @@ models: JSON: model: - go.infratographer.com/x/entx.RawMessage -schema: ["schema.graphql"] +schema: ["internal/graphclient/schema/schema.graphql"] query: ["internal/graphclient/*.graphql"] generate: client: true - clientInterfaceName: "GraphClient" \ No newline at end of file + clientInterfaceName: "GraphClient" diff --git a/internal/ent/generated/client.go b/internal/ent/generated/client.go index 56f7d2bbe..9a2e4b9a5 100644 --- a/internal/ent/generated/client.go +++ b/internal/ent/generated/client.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -19,8 +29,6 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "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" @@ -36,10 +44,6 @@ type Client struct { Schema *migrate.Schema // LoadBalancer is the client for interacting with the LoadBalancer builders. LoadBalancer *LoadBalancerClient - // LoadBalancerAnnotation is the client for interacting with the LoadBalancerAnnotation builders. - LoadBalancerAnnotation *LoadBalancerAnnotationClient - // LoadBalancerStatus is the client for interacting with the LoadBalancerStatus builders. - LoadBalancerStatus *LoadBalancerStatusClient // Origin is the client for interacting with the Origin builders. Origin *OriginClient // Pool is the client for interacting with the Pool builders. @@ -62,8 +66,6 @@ func NewClient(opts ...Option) *Client { func (c *Client) init() { c.Schema = migrate.NewSchema(c.driver) c.LoadBalancer = NewLoadBalancerClient(c.config) - c.LoadBalancerAnnotation = NewLoadBalancerAnnotationClient(c.config) - c.LoadBalancerStatus = NewLoadBalancerStatusClient(c.config) c.Origin = NewOriginClient(c.config) c.Pool = NewPoolClient(c.config) c.Port = NewPortClient(c.config) @@ -156,15 +158,13 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) { cfg := c.config cfg.driver = tx return &Tx{ - ctx: ctx, - config: cfg, - LoadBalancer: NewLoadBalancerClient(cfg), - LoadBalancerAnnotation: NewLoadBalancerAnnotationClient(cfg), - LoadBalancerStatus: NewLoadBalancerStatusClient(cfg), - Origin: NewOriginClient(cfg), - Pool: NewPoolClient(cfg), - Port: NewPortClient(cfg), - Provider: NewProviderClient(cfg), + ctx: ctx, + config: cfg, + LoadBalancer: NewLoadBalancerClient(cfg), + Origin: NewOriginClient(cfg), + Pool: NewPoolClient(cfg), + Port: NewPortClient(cfg), + Provider: NewProviderClient(cfg), }, nil } @@ -182,15 +182,13 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) cfg := c.config cfg.driver = &txDriver{tx: tx, drv: c.driver} return &Tx{ - ctx: ctx, - config: cfg, - LoadBalancer: NewLoadBalancerClient(cfg), - LoadBalancerAnnotation: NewLoadBalancerAnnotationClient(cfg), - LoadBalancerStatus: NewLoadBalancerStatusClient(cfg), - Origin: NewOriginClient(cfg), - Pool: NewPoolClient(cfg), - Port: NewPortClient(cfg), - Provider: NewProviderClient(cfg), + ctx: ctx, + config: cfg, + LoadBalancer: NewLoadBalancerClient(cfg), + Origin: NewOriginClient(cfg), + Pool: NewPoolClient(cfg), + Port: NewPortClient(cfg), + Provider: NewProviderClient(cfg), }, nil } @@ -219,23 +217,21 @@ func (c *Client) Close() error { // Use adds the mutation hooks to all the entity clients. // In order to add hooks to a specific client, call: `client.Node.Use(...)`. func (c *Client) Use(hooks ...Hook) { - for _, n := range []interface{ Use(...Hook) }{ - c.LoadBalancer, c.LoadBalancerAnnotation, c.LoadBalancerStatus, c.Origin, - c.Pool, c.Port, c.Provider, - } { - n.Use(hooks...) - } + c.LoadBalancer.Use(hooks...) + c.Origin.Use(hooks...) + c.Pool.Use(hooks...) + c.Port.Use(hooks...) + c.Provider.Use(hooks...) } // Intercept adds the query interceptors to all the entity clients. // In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`. func (c *Client) Intercept(interceptors ...Interceptor) { - for _, n := range []interface{ Intercept(...Interceptor) }{ - c.LoadBalancer, c.LoadBalancerAnnotation, c.LoadBalancerStatus, c.Origin, - c.Pool, c.Port, c.Provider, - } { - n.Intercept(interceptors...) - } + c.LoadBalancer.Intercept(interceptors...) + c.Origin.Intercept(interceptors...) + c.Pool.Intercept(interceptors...) + c.Port.Intercept(interceptors...) + c.Provider.Intercept(interceptors...) } // Mutate implements the ent.Mutator interface. @@ -243,10 +239,6 @@ func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) { switch m := m.(type) { case *LoadBalancerMutation: return c.LoadBalancer.mutate(ctx, m) - case *LoadBalancerAnnotationMutation: - return c.LoadBalancerAnnotation.mutate(ctx, m) - case *LoadBalancerStatusMutation: - return c.LoadBalancerStatus.mutate(ctx, m) case *OriginMutation: return c.Origin.mutate(ctx, m) case *PoolMutation: @@ -353,38 +345,6 @@ func (c *LoadBalancerClient) GetX(ctx context.Context, id gidx.PrefixedID) *Load return obj } -// QueryAnnotations queries the annotations edge of a LoadBalancer. -func (c *LoadBalancerClient) QueryAnnotations(lb *LoadBalancer) *LoadBalancerAnnotationQuery { - query := (&LoadBalancerAnnotationClient{config: c.config}).Query() - query.path = func(context.Context) (fromV *sql.Selector, _ error) { - id := lb.ID - step := sqlgraph.NewStep( - sqlgraph.From(loadbalancer.Table, loadbalancer.FieldID, id), - sqlgraph.To(loadbalancerannotation.Table, loadbalancerannotation.FieldID), - sqlgraph.Edge(sqlgraph.O2M, true, loadbalancer.AnnotationsTable, loadbalancer.AnnotationsColumn), - ) - fromV = sqlgraph.Neighbors(lb.driver.Dialect(), step) - return fromV, nil - } - return query -} - -// QueryStatuses queries the statuses edge of a LoadBalancer. -func (c *LoadBalancerClient) QueryStatuses(lb *LoadBalancer) *LoadBalancerStatusQuery { - query := (&LoadBalancerStatusClient{config: c.config}).Query() - query.path = func(context.Context) (fromV *sql.Selector, _ error) { - id := lb.ID - step := sqlgraph.NewStep( - sqlgraph.From(loadbalancer.Table, loadbalancer.FieldID, id), - sqlgraph.To(loadbalancerstatus.Table, loadbalancerstatus.FieldID), - sqlgraph.Edge(sqlgraph.O2M, true, loadbalancer.StatusesTable, loadbalancer.StatusesColumn), - ) - fromV = sqlgraph.Neighbors(lb.driver.Dialect(), step) - return fromV, nil - } - return query -} - // QueryPorts queries the ports edge of a LoadBalancer. func (c *LoadBalancerClient) QueryPorts(lb *LoadBalancer) *PortQuery { query := (&PortClient{config: c.config}).Query() @@ -442,274 +402,6 @@ func (c *LoadBalancerClient) mutate(ctx context.Context, m *LoadBalancerMutation } } -// LoadBalancerAnnotationClient is a client for the LoadBalancerAnnotation schema. -type LoadBalancerAnnotationClient struct { - config -} - -// NewLoadBalancerAnnotationClient returns a client for the LoadBalancerAnnotation from the given config. -func NewLoadBalancerAnnotationClient(c config) *LoadBalancerAnnotationClient { - return &LoadBalancerAnnotationClient{config: c} -} - -// Use adds a list of mutation hooks to the hooks stack. -// A call to `Use(f, g, h)` equals to `loadbalancerannotation.Hooks(f(g(h())))`. -func (c *LoadBalancerAnnotationClient) Use(hooks ...Hook) { - c.hooks.LoadBalancerAnnotation = append(c.hooks.LoadBalancerAnnotation, hooks...) -} - -// Intercept adds a list of query interceptors to the interceptors stack. -// A call to `Intercept(f, g, h)` equals to `loadbalancerannotation.Intercept(f(g(h())))`. -func (c *LoadBalancerAnnotationClient) Intercept(interceptors ...Interceptor) { - c.inters.LoadBalancerAnnotation = append(c.inters.LoadBalancerAnnotation, interceptors...) -} - -// Create returns a builder for creating a LoadBalancerAnnotation entity. -func (c *LoadBalancerAnnotationClient) Create() *LoadBalancerAnnotationCreate { - mutation := newLoadBalancerAnnotationMutation(c.config, OpCreate) - return &LoadBalancerAnnotationCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} -} - -// CreateBulk returns a builder for creating a bulk of LoadBalancerAnnotation entities. -func (c *LoadBalancerAnnotationClient) CreateBulk(builders ...*LoadBalancerAnnotationCreate) *LoadBalancerAnnotationCreateBulk { - return &LoadBalancerAnnotationCreateBulk{config: c.config, builders: builders} -} - -// Update returns an update builder for LoadBalancerAnnotation. -func (c *LoadBalancerAnnotationClient) Update() *LoadBalancerAnnotationUpdate { - mutation := newLoadBalancerAnnotationMutation(c.config, OpUpdate) - return &LoadBalancerAnnotationUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} -} - -// UpdateOne returns an update builder for the given entity. -func (c *LoadBalancerAnnotationClient) UpdateOne(lba *LoadBalancerAnnotation) *LoadBalancerAnnotationUpdateOne { - mutation := newLoadBalancerAnnotationMutation(c.config, OpUpdateOne, withLoadBalancerAnnotation(lba)) - return &LoadBalancerAnnotationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} -} - -// UpdateOneID returns an update builder for the given id. -func (c *LoadBalancerAnnotationClient) UpdateOneID(id gidx.PrefixedID) *LoadBalancerAnnotationUpdateOne { - mutation := newLoadBalancerAnnotationMutation(c.config, OpUpdateOne, withLoadBalancerAnnotationID(id)) - return &LoadBalancerAnnotationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} -} - -// Delete returns a delete builder for LoadBalancerAnnotation. -func (c *LoadBalancerAnnotationClient) Delete() *LoadBalancerAnnotationDelete { - mutation := newLoadBalancerAnnotationMutation(c.config, OpDelete) - return &LoadBalancerAnnotationDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} -} - -// DeleteOne returns a builder for deleting the given entity. -func (c *LoadBalancerAnnotationClient) DeleteOne(lba *LoadBalancerAnnotation) *LoadBalancerAnnotationDeleteOne { - return c.DeleteOneID(lba.ID) -} - -// DeleteOneID returns a builder for deleting the given entity by its id. -func (c *LoadBalancerAnnotationClient) DeleteOneID(id gidx.PrefixedID) *LoadBalancerAnnotationDeleteOne { - builder := c.Delete().Where(loadbalancerannotation.ID(id)) - builder.mutation.id = &id - builder.mutation.op = OpDeleteOne - return &LoadBalancerAnnotationDeleteOne{builder} -} - -// Query returns a query builder for LoadBalancerAnnotation. -func (c *LoadBalancerAnnotationClient) Query() *LoadBalancerAnnotationQuery { - return &LoadBalancerAnnotationQuery{ - config: c.config, - ctx: &QueryContext{Type: TypeLoadBalancerAnnotation}, - inters: c.Interceptors(), - } -} - -// Get returns a LoadBalancerAnnotation entity by its id. -func (c *LoadBalancerAnnotationClient) Get(ctx context.Context, id gidx.PrefixedID) (*LoadBalancerAnnotation, error) { - return c.Query().Where(loadbalancerannotation.ID(id)).Only(ctx) -} - -// GetX is like Get, but panics if an error occurs. -func (c *LoadBalancerAnnotationClient) GetX(ctx context.Context, id gidx.PrefixedID) *LoadBalancerAnnotation { - obj, err := c.Get(ctx, id) - if err != nil { - panic(err) - } - return obj -} - -// QueryLoadBalancer queries the load_balancer edge of a LoadBalancerAnnotation. -func (c *LoadBalancerAnnotationClient) QueryLoadBalancer(lba *LoadBalancerAnnotation) *LoadBalancerQuery { - query := (&LoadBalancerClient{config: c.config}).Query() - query.path = func(context.Context) (fromV *sql.Selector, _ error) { - id := lba.ID - step := sqlgraph.NewStep( - sqlgraph.From(loadbalancerannotation.Table, loadbalancerannotation.FieldID, id), - sqlgraph.To(loadbalancer.Table, loadbalancer.FieldID), - sqlgraph.Edge(sqlgraph.M2O, false, loadbalancerannotation.LoadBalancerTable, loadbalancerannotation.LoadBalancerColumn), - ) - fromV = sqlgraph.Neighbors(lba.driver.Dialect(), step) - return fromV, nil - } - return query -} - -// Hooks returns the client hooks. -func (c *LoadBalancerAnnotationClient) Hooks() []Hook { - return c.hooks.LoadBalancerAnnotation -} - -// Interceptors returns the client interceptors. -func (c *LoadBalancerAnnotationClient) Interceptors() []Interceptor { - return c.inters.LoadBalancerAnnotation -} - -func (c *LoadBalancerAnnotationClient) mutate(ctx context.Context, m *LoadBalancerAnnotationMutation) (Value, error) { - switch m.Op() { - case OpCreate: - return (&LoadBalancerAnnotationCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) - case OpUpdate: - return (&LoadBalancerAnnotationUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) - case OpUpdateOne: - return (&LoadBalancerAnnotationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) - case OpDelete, OpDeleteOne: - return (&LoadBalancerAnnotationDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) - default: - return nil, fmt.Errorf("generated: unknown LoadBalancerAnnotation mutation op: %q", m.Op()) - } -} - -// LoadBalancerStatusClient is a client for the LoadBalancerStatus schema. -type LoadBalancerStatusClient struct { - config -} - -// NewLoadBalancerStatusClient returns a client for the LoadBalancerStatus from the given config. -func NewLoadBalancerStatusClient(c config) *LoadBalancerStatusClient { - return &LoadBalancerStatusClient{config: c} -} - -// Use adds a list of mutation hooks to the hooks stack. -// A call to `Use(f, g, h)` equals to `loadbalancerstatus.Hooks(f(g(h())))`. -func (c *LoadBalancerStatusClient) Use(hooks ...Hook) { - c.hooks.LoadBalancerStatus = append(c.hooks.LoadBalancerStatus, hooks...) -} - -// Intercept adds a list of query interceptors to the interceptors stack. -// A call to `Intercept(f, g, h)` equals to `loadbalancerstatus.Intercept(f(g(h())))`. -func (c *LoadBalancerStatusClient) Intercept(interceptors ...Interceptor) { - c.inters.LoadBalancerStatus = append(c.inters.LoadBalancerStatus, interceptors...) -} - -// Create returns a builder for creating a LoadBalancerStatus entity. -func (c *LoadBalancerStatusClient) Create() *LoadBalancerStatusCreate { - mutation := newLoadBalancerStatusMutation(c.config, OpCreate) - return &LoadBalancerStatusCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} -} - -// CreateBulk returns a builder for creating a bulk of LoadBalancerStatus entities. -func (c *LoadBalancerStatusClient) CreateBulk(builders ...*LoadBalancerStatusCreate) *LoadBalancerStatusCreateBulk { - return &LoadBalancerStatusCreateBulk{config: c.config, builders: builders} -} - -// Update returns an update builder for LoadBalancerStatus. -func (c *LoadBalancerStatusClient) Update() *LoadBalancerStatusUpdate { - mutation := newLoadBalancerStatusMutation(c.config, OpUpdate) - return &LoadBalancerStatusUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} -} - -// UpdateOne returns an update builder for the given entity. -func (c *LoadBalancerStatusClient) UpdateOne(lbs *LoadBalancerStatus) *LoadBalancerStatusUpdateOne { - mutation := newLoadBalancerStatusMutation(c.config, OpUpdateOne, withLoadBalancerStatus(lbs)) - return &LoadBalancerStatusUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} -} - -// UpdateOneID returns an update builder for the given id. -func (c *LoadBalancerStatusClient) UpdateOneID(id gidx.PrefixedID) *LoadBalancerStatusUpdateOne { - mutation := newLoadBalancerStatusMutation(c.config, OpUpdateOne, withLoadBalancerStatusID(id)) - return &LoadBalancerStatusUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} -} - -// Delete returns a delete builder for LoadBalancerStatus. -func (c *LoadBalancerStatusClient) Delete() *LoadBalancerStatusDelete { - mutation := newLoadBalancerStatusMutation(c.config, OpDelete) - return &LoadBalancerStatusDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} -} - -// DeleteOne returns a builder for deleting the given entity. -func (c *LoadBalancerStatusClient) DeleteOne(lbs *LoadBalancerStatus) *LoadBalancerStatusDeleteOne { - return c.DeleteOneID(lbs.ID) -} - -// DeleteOneID returns a builder for deleting the given entity by its id. -func (c *LoadBalancerStatusClient) DeleteOneID(id gidx.PrefixedID) *LoadBalancerStatusDeleteOne { - builder := c.Delete().Where(loadbalancerstatus.ID(id)) - builder.mutation.id = &id - builder.mutation.op = OpDeleteOne - return &LoadBalancerStatusDeleteOne{builder} -} - -// Query returns a query builder for LoadBalancerStatus. -func (c *LoadBalancerStatusClient) Query() *LoadBalancerStatusQuery { - return &LoadBalancerStatusQuery{ - config: c.config, - ctx: &QueryContext{Type: TypeLoadBalancerStatus}, - inters: c.Interceptors(), - } -} - -// Get returns a LoadBalancerStatus entity by its id. -func (c *LoadBalancerStatusClient) Get(ctx context.Context, id gidx.PrefixedID) (*LoadBalancerStatus, error) { - return c.Query().Where(loadbalancerstatus.ID(id)).Only(ctx) -} - -// GetX is like Get, but panics if an error occurs. -func (c *LoadBalancerStatusClient) GetX(ctx context.Context, id gidx.PrefixedID) *LoadBalancerStatus { - obj, err := c.Get(ctx, id) - if err != nil { - panic(err) - } - return obj -} - -// QueryLoadBalancer queries the load_balancer edge of a LoadBalancerStatus. -func (c *LoadBalancerStatusClient) QueryLoadBalancer(lbs *LoadBalancerStatus) *LoadBalancerQuery { - query := (&LoadBalancerClient{config: c.config}).Query() - query.path = func(context.Context) (fromV *sql.Selector, _ error) { - id := lbs.ID - step := sqlgraph.NewStep( - sqlgraph.From(loadbalancerstatus.Table, loadbalancerstatus.FieldID, id), - sqlgraph.To(loadbalancer.Table, loadbalancer.FieldID), - sqlgraph.Edge(sqlgraph.M2O, false, loadbalancerstatus.LoadBalancerTable, loadbalancerstatus.LoadBalancerColumn), - ) - fromV = sqlgraph.Neighbors(lbs.driver.Dialect(), step) - return fromV, nil - } - return query -} - -// Hooks returns the client hooks. -func (c *LoadBalancerStatusClient) Hooks() []Hook { - return c.hooks.LoadBalancerStatus -} - -// Interceptors returns the client interceptors. -func (c *LoadBalancerStatusClient) Interceptors() []Interceptor { - return c.inters.LoadBalancerStatus -} - -func (c *LoadBalancerStatusClient) mutate(ctx context.Context, m *LoadBalancerStatusMutation) (Value, error) { - switch m.Op() { - case OpCreate: - return (&LoadBalancerStatusCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) - case OpUpdate: - return (&LoadBalancerStatusUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) - case OpUpdateOne: - return (&LoadBalancerStatusUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) - case OpDelete, OpDeleteOne: - return (&LoadBalancerStatusDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) - default: - return nil, fmt.Errorf("generated: unknown LoadBalancerStatus mutation op: %q", m.Op()) - } -} - // OriginClient is a client for the Origin schema. type OriginClient struct { config @@ -1281,11 +973,9 @@ func (c *ProviderClient) mutate(ctx context.Context, m *ProviderMutation) (Value // hooks and interceptors per client, for fast access. type ( hooks struct { - LoadBalancer, LoadBalancerAnnotation, LoadBalancerStatus, Origin, Pool, Port, - Provider []ent.Hook + LoadBalancer, Origin, Pool, Port, Provider []ent.Hook } inters struct { - LoadBalancer, LoadBalancerAnnotation, LoadBalancerStatus, Origin, Pool, Port, - Provider []ent.Interceptor + LoadBalancer, Origin, Pool, Port, Provider []ent.Interceptor } ) diff --git a/internal/ent/generated/ent.go b/internal/ent/generated/ent.go index a23bcda9e..e783adca9 100644 --- a/internal/ent/generated/ent.go +++ b/internal/ent/generated/ent.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -17,8 +27,6 @@ import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "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" @@ -83,13 +91,11 @@ var ( func checkColumn(table, column string) error { initCheck.Do(func() { columnCheck = sql.NewColumnCheck(map[string]func(string) bool{ - loadbalancer.Table: loadbalancer.ValidColumn, - loadbalancerannotation.Table: loadbalancerannotation.ValidColumn, - loadbalancerstatus.Table: loadbalancerstatus.ValidColumn, - origin.Table: origin.ValidColumn, - pool.Table: pool.ValidColumn, - port.Table: port.ValidColumn, - provider.Table: provider.ValidColumn, + loadbalancer.Table: loadbalancer.ValidColumn, + origin.Table: origin.ValidColumn, + pool.Table: pool.ValidColumn, + port.Table: port.ValidColumn, + provider.Table: provider.ValidColumn, }) }) return columnCheck(table, column) diff --git a/internal/ent/generated/enttest/enttest.go b/internal/ent/generated/enttest/enttest.go index 795118cda..12fab7341 100644 --- a/internal/ent/generated/enttest/enttest.go +++ b/internal/ent/generated/enttest/enttest.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/gql_collection.go b/internal/ent/generated/gql_collection.go index b71dc8b8c..8e12e89f9 100644 --- a/internal/ent/generated/gql_collection.go +++ b/internal/ent/generated/gql_collection.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -15,8 +25,6 @@ import ( "entgo.io/ent/dialect/sql" "github.com/99designs/gqlgen/graphql" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "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" @@ -45,174 +53,6 @@ func (lb *LoadBalancerQuery) collectField(ctx context.Context, opCtx *graphql.Op ) for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { switch field.Name { - case "annotations": - var ( - alias = field.Alias - path = append(path, alias) - query = (&LoadBalancerAnnotationClient{config: lb.config}).Query() - ) - args := newLoadBalancerAnnotationPaginateArgs(fieldArgs(ctx, new(LoadBalancerAnnotationWhereInput), path...)) - if err := validateFirstLast(args.first, args.last); err != nil { - return fmt.Errorf("validate first and last in path %q: %w", path, err) - } - pager, err := newLoadBalancerAnnotationPager(args.opts, args.last != nil) - if err != nil { - return fmt.Errorf("create new pager in path %q: %w", path, err) - } - if query, err = pager.applyFilter(query); err != nil { - return err - } - ignoredEdges := !hasCollectedField(ctx, append(path, edgesField)...) - if hasCollectedField(ctx, append(path, totalCountField)...) || hasCollectedField(ctx, append(path, pageInfoField)...) { - hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil - if hasPagination || ignoredEdges { - query := query.Clone() - lb.loadTotal = append(lb.loadTotal, func(ctx context.Context, nodes []*LoadBalancer) error { - ids := make([]driver.Value, len(nodes)) - for i := range nodes { - ids[i] = nodes[i].ID - } - var v []struct { - NodeID gidx.PrefixedID `sql:"load_balancer_id"` - Count int `sql:"count"` - } - query.Where(func(s *sql.Selector) { - s.Where(sql.InValues(s.C(loadbalancer.AnnotationsColumn), ids...)) - }) - if err := query.GroupBy(loadbalancer.AnnotationsColumn).Aggregate(Count()).Scan(ctx, &v); err != nil { - return err - } - m := make(map[gidx.PrefixedID]int, len(v)) - for i := range v { - m[v[i].NodeID] = v[i].Count - } - for i := range nodes { - n := m[nodes[i].ID] - if nodes[i].Edges.totalCount[0] == nil { - nodes[i].Edges.totalCount[0] = make(map[string]int) - } - nodes[i].Edges.totalCount[0][alias] = n - } - return nil - }) - } else { - lb.loadTotal = append(lb.loadTotal, func(_ context.Context, nodes []*LoadBalancer) error { - for i := range nodes { - n := len(nodes[i].Edges.Annotations) - if nodes[i].Edges.totalCount[0] == nil { - nodes[i].Edges.totalCount[0] = make(map[string]int) - } - nodes[i].Edges.totalCount[0][alias] = n - } - return nil - }) - } - } - if ignoredEdges || (args.first != nil && *args.first == 0) || (args.last != nil && *args.last == 0) { - continue - } - if query, err = pager.applyCursors(query, args.after, args.before); err != nil { - return err - } - path = append(path, edgesField, nodeField) - if field := collectedField(ctx, path...); field != nil { - if err := query.collectField(ctx, opCtx, *field, path, mayAddCondition(satisfies, "LoadBalancerAnnotation")...); err != nil { - return err - } - } - if limit := paginateLimit(args.first, args.last); limit > 0 { - modify := limitRows(loadbalancer.AnnotationsColumn, limit, pager.orderExpr(query)) - query.modifiers = append(query.modifiers, modify) - } else { - query = pager.applyOrder(query) - } - lb.WithNamedAnnotations(alias, func(wq *LoadBalancerAnnotationQuery) { - *wq = *query - }) - case "statuses": - var ( - alias = field.Alias - path = append(path, alias) - query = (&LoadBalancerStatusClient{config: lb.config}).Query() - ) - args := newLoadBalancerStatusPaginateArgs(fieldArgs(ctx, new(LoadBalancerStatusWhereInput), path...)) - if err := validateFirstLast(args.first, args.last); err != nil { - return fmt.Errorf("validate first and last in path %q: %w", path, err) - } - pager, err := newLoadBalancerStatusPager(args.opts, args.last != nil) - if err != nil { - return fmt.Errorf("create new pager in path %q: %w", path, err) - } - if query, err = pager.applyFilter(query); err != nil { - return err - } - ignoredEdges := !hasCollectedField(ctx, append(path, edgesField)...) - if hasCollectedField(ctx, append(path, totalCountField)...) || hasCollectedField(ctx, append(path, pageInfoField)...) { - hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil - if hasPagination || ignoredEdges { - query := query.Clone() - lb.loadTotal = append(lb.loadTotal, func(ctx context.Context, nodes []*LoadBalancer) error { - ids := make([]driver.Value, len(nodes)) - for i := range nodes { - ids[i] = nodes[i].ID - } - var v []struct { - NodeID gidx.PrefixedID `sql:"load_balancer_id"` - Count int `sql:"count"` - } - query.Where(func(s *sql.Selector) { - s.Where(sql.InValues(s.C(loadbalancer.StatusesColumn), ids...)) - }) - if err := query.GroupBy(loadbalancer.StatusesColumn).Aggregate(Count()).Scan(ctx, &v); err != nil { - return err - } - m := make(map[gidx.PrefixedID]int, len(v)) - for i := range v { - m[v[i].NodeID] = v[i].Count - } - for i := range nodes { - n := m[nodes[i].ID] - if nodes[i].Edges.totalCount[1] == nil { - nodes[i].Edges.totalCount[1] = make(map[string]int) - } - nodes[i].Edges.totalCount[1][alias] = n - } - return nil - }) - } else { - lb.loadTotal = append(lb.loadTotal, func(_ context.Context, nodes []*LoadBalancer) error { - for i := range nodes { - n := len(nodes[i].Edges.Statuses) - if nodes[i].Edges.totalCount[1] == nil { - nodes[i].Edges.totalCount[1] = make(map[string]int) - } - nodes[i].Edges.totalCount[1][alias] = n - } - return nil - }) - } - } - if ignoredEdges || (args.first != nil && *args.first == 0) || (args.last != nil && *args.last == 0) { - continue - } - if query, err = pager.applyCursors(query, args.after, args.before); err != nil { - return err - } - path = append(path, edgesField, nodeField) - if field := collectedField(ctx, path...); field != nil { - if err := query.collectField(ctx, opCtx, *field, path, mayAddCondition(satisfies, "LoadBalancerStatus")...); err != nil { - return err - } - } - if limit := paginateLimit(args.first, args.last); limit > 0 { - modify := limitRows(loadbalancer.StatusesColumn, limit, pager.orderExpr(query)) - query.modifiers = append(query.modifiers, modify) - } else { - query = pager.applyOrder(query) - } - lb.WithNamedStatuses(alias, func(wq *LoadBalancerStatusQuery) { - *wq = *query - }) case "ports": var ( alias = field.Alias @@ -256,10 +96,10 @@ func (lb *LoadBalancerQuery) collectField(ctx context.Context, opCtx *graphql.Op } for i := range nodes { n := m[nodes[i].ID] - if nodes[i].Edges.totalCount[2] == nil { - nodes[i].Edges.totalCount[2] = make(map[string]int) + if nodes[i].Edges.totalCount[0] == nil { + nodes[i].Edges.totalCount[0] = make(map[string]int) } - nodes[i].Edges.totalCount[2][alias] = n + nodes[i].Edges.totalCount[0][alias] = n } return nil }) @@ -267,10 +107,10 @@ func (lb *LoadBalancerQuery) collectField(ctx context.Context, opCtx *graphql.Op lb.loadTotal = append(lb.loadTotal, func(_ context.Context, nodes []*LoadBalancer) error { for i := range nodes { n := len(nodes[i].Edges.Ports) - if nodes[i].Edges.totalCount[2] == nil { - nodes[i].Edges.totalCount[2] = make(map[string]int) + if nodes[i].Edges.totalCount[0] == nil { + nodes[i].Edges.totalCount[0] = make(map[string]int) } - nodes[i].Edges.totalCount[2][alias] = n + nodes[i].Edges.totalCount[0][alias] = n } return nil }) @@ -389,237 +229,6 @@ func newLoadBalancerPaginateArgs(rv map[string]any) *loadbalancerPaginateArgs { return args } -// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (lba *LoadBalancerAnnotationQuery) CollectFields(ctx context.Context, satisfies ...string) (*LoadBalancerAnnotationQuery, error) { - fc := graphql.GetFieldContext(ctx) - if fc == nil { - return lba, nil - } - if err := lba.collectField(ctx, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { - return nil, err - } - return lba, nil -} - -func (lba *LoadBalancerAnnotationQuery) collectField(ctx context.Context, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { - path = append([]string(nil), path...) - var ( - unknownSeen bool - fieldSeen = make(map[string]struct{}, len(loadbalancerannotation.Columns)) - selectedFields = []string{loadbalancerannotation.FieldID} - ) - for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { - switch field.Name { - case "loadBalancer": - var ( - alias = field.Alias - path = append(path, alias) - query = (&LoadBalancerClient{config: lba.config}).Query() - ) - if err := query.collectField(ctx, opCtx, field, path, satisfies...); err != nil { - return err - } - lba.withLoadBalancer = query - if _, ok := fieldSeen[loadbalancerannotation.FieldLoadBalancerID]; !ok { - selectedFields = append(selectedFields, loadbalancerannotation.FieldLoadBalancerID) - fieldSeen[loadbalancerannotation.FieldLoadBalancerID] = struct{}{} - } - case "createdAt": - if _, ok := fieldSeen[loadbalancerannotation.FieldCreatedAt]; !ok { - selectedFields = append(selectedFields, loadbalancerannotation.FieldCreatedAt) - fieldSeen[loadbalancerannotation.FieldCreatedAt] = struct{}{} - } - case "updatedAt": - if _, ok := fieldSeen[loadbalancerannotation.FieldUpdatedAt]; !ok { - selectedFields = append(selectedFields, loadbalancerannotation.FieldUpdatedAt) - fieldSeen[loadbalancerannotation.FieldUpdatedAt] = struct{}{} - } - case "loadBalancerID": - if _, ok := fieldSeen[loadbalancerannotation.FieldLoadBalancerID]; !ok { - selectedFields = append(selectedFields, loadbalancerannotation.FieldLoadBalancerID) - fieldSeen[loadbalancerannotation.FieldLoadBalancerID] = struct{}{} - } - case "id": - case "__typename": - default: - unknownSeen = true - } - } - if !unknownSeen { - lba.Select(selectedFields...) - } - return nil -} - -type loadbalancerannotationPaginateArgs struct { - first, last *int - after, before *Cursor - opts []LoadBalancerAnnotationPaginateOption -} - -func newLoadBalancerAnnotationPaginateArgs(rv map[string]any) *loadbalancerannotationPaginateArgs { - args := &loadbalancerannotationPaginateArgs{} - if rv == nil { - return args - } - if v := rv[firstField]; v != nil { - args.first = v.(*int) - } - if v := rv[lastField]; v != nil { - args.last = v.(*int) - } - if v := rv[afterField]; v != nil { - args.after = v.(*Cursor) - } - if v := rv[beforeField]; v != nil { - args.before = v.(*Cursor) - } - if v, ok := rv[orderByField]; ok { - switch v := v.(type) { - case map[string]any: - var ( - err1, err2 error - order = &LoadBalancerAnnotationOrder{Field: &LoadBalancerAnnotationOrderField{}, Direction: entgql.OrderDirectionAsc} - ) - if d, ok := v[directionField]; ok { - err1 = order.Direction.UnmarshalGQL(d) - } - if f, ok := v[fieldField]; ok { - err2 = order.Field.UnmarshalGQL(f) - } - if err1 == nil && err2 == nil { - args.opts = append(args.opts, WithLoadBalancerAnnotationOrder(order)) - } - case *LoadBalancerAnnotationOrder: - if v != nil { - args.opts = append(args.opts, WithLoadBalancerAnnotationOrder(v)) - } - } - } - if v, ok := rv[whereField].(*LoadBalancerAnnotationWhereInput); ok { - args.opts = append(args.opts, WithLoadBalancerAnnotationFilter(v.Filter)) - } - return args -} - -// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (lbs *LoadBalancerStatusQuery) CollectFields(ctx context.Context, satisfies ...string) (*LoadBalancerStatusQuery, error) { - fc := graphql.GetFieldContext(ctx) - if fc == nil { - return lbs, nil - } - if err := lbs.collectField(ctx, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { - return nil, err - } - return lbs, nil -} - -func (lbs *LoadBalancerStatusQuery) collectField(ctx context.Context, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { - path = append([]string(nil), path...) - var ( - unknownSeen bool - fieldSeen = make(map[string]struct{}, len(loadbalancerstatus.Columns)) - selectedFields = []string{loadbalancerstatus.FieldID} - ) - for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { - switch field.Name { - case "loadBalancer": - var ( - alias = field.Alias - path = append(path, alias) - query = (&LoadBalancerClient{config: lbs.config}).Query() - ) - if err := query.collectField(ctx, opCtx, field, path, satisfies...); err != nil { - return err - } - lbs.withLoadBalancer = query - if _, ok := fieldSeen[loadbalancerstatus.FieldLoadBalancerID]; !ok { - selectedFields = append(selectedFields, loadbalancerstatus.FieldLoadBalancerID) - fieldSeen[loadbalancerstatus.FieldLoadBalancerID] = struct{}{} - } - case "createdAt": - if _, ok := fieldSeen[loadbalancerstatus.FieldCreatedAt]; !ok { - selectedFields = append(selectedFields, loadbalancerstatus.FieldCreatedAt) - fieldSeen[loadbalancerstatus.FieldCreatedAt] = struct{}{} - } - case "updatedAt": - if _, ok := fieldSeen[loadbalancerstatus.FieldUpdatedAt]; !ok { - selectedFields = append(selectedFields, loadbalancerstatus.FieldUpdatedAt) - fieldSeen[loadbalancerstatus.FieldUpdatedAt] = struct{}{} - } - case "loadBalancerID": - if _, ok := fieldSeen[loadbalancerstatus.FieldLoadBalancerID]; !ok { - selectedFields = append(selectedFields, loadbalancerstatus.FieldLoadBalancerID) - fieldSeen[loadbalancerstatus.FieldLoadBalancerID] = struct{}{} - } - case "source": - if _, ok := fieldSeen[loadbalancerstatus.FieldSource]; !ok { - selectedFields = append(selectedFields, loadbalancerstatus.FieldSource) - fieldSeen[loadbalancerstatus.FieldSource] = struct{}{} - } - case "id": - case "__typename": - default: - unknownSeen = true - } - } - if !unknownSeen { - lbs.Select(selectedFields...) - } - return nil -} - -type loadbalancerstatusPaginateArgs struct { - first, last *int - after, before *Cursor - opts []LoadBalancerStatusPaginateOption -} - -func newLoadBalancerStatusPaginateArgs(rv map[string]any) *loadbalancerstatusPaginateArgs { - args := &loadbalancerstatusPaginateArgs{} - if rv == nil { - return args - } - if v := rv[firstField]; v != nil { - args.first = v.(*int) - } - if v := rv[lastField]; v != nil { - args.last = v.(*int) - } - if v := rv[afterField]; v != nil { - args.after = v.(*Cursor) - } - if v := rv[beforeField]; v != nil { - args.before = v.(*Cursor) - } - if v, ok := rv[orderByField]; ok { - switch v := v.(type) { - case map[string]any: - var ( - err1, err2 error - order = &LoadBalancerStatusOrder{Field: &LoadBalancerStatusOrderField{}, Direction: entgql.OrderDirectionAsc} - ) - if d, ok := v[directionField]; ok { - err1 = order.Direction.UnmarshalGQL(d) - } - if f, ok := v[fieldField]; ok { - err2 = order.Field.UnmarshalGQL(f) - } - if err1 == nil && err2 == nil { - args.opts = append(args.opts, WithLoadBalancerStatusOrder(order)) - } - case *LoadBalancerStatusOrder: - if v != nil { - args.opts = append(args.opts, WithLoadBalancerStatusOrder(v)) - } - } - } - if v, ok := rv[whereField].(*LoadBalancerStatusWhereInput); ok { - args.opts = append(args.opts, WithLoadBalancerStatusFilter(v.Filter)) - } - return args -} - // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. func (o *OriginQuery) CollectFields(ctx context.Context, satisfies ...string) (*OriginQuery, error) { fc := graphql.GetFieldContext(ctx) diff --git a/internal/ent/generated/gql_edge.go b/internal/ent/generated/gql_edge.go index 3244ca181..36f9cf541 100644 --- a/internal/ent/generated/gql_edge.go +++ b/internal/ent/generated/gql_edge.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -12,48 +22,6 @@ import ( "github.com/99designs/gqlgen/graphql" ) -func (lb *LoadBalancer) Annotations( - ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *LoadBalancerAnnotationOrder, where *LoadBalancerAnnotationWhereInput, -) (*LoadBalancerAnnotationConnection, error) { - opts := []LoadBalancerAnnotationPaginateOption{ - WithLoadBalancerAnnotationOrder(orderBy), - WithLoadBalancerAnnotationFilter(where.Filter), - } - alias := graphql.GetFieldContext(ctx).Field.Alias - totalCount, hasTotalCount := lb.Edges.totalCount[0][alias] - if nodes, err := lb.NamedAnnotations(alias); err == nil || hasTotalCount { - pager, err := newLoadBalancerAnnotationPager(opts, last != nil) - if err != nil { - return nil, err - } - conn := &LoadBalancerAnnotationConnection{Edges: []*LoadBalancerAnnotationEdge{}, TotalCount: totalCount} - conn.build(nodes, pager, after, first, before, last) - return conn, nil - } - return lb.QueryAnnotations().Paginate(ctx, after, first, before, last, opts...) -} - -func (lb *LoadBalancer) Statuses( - ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *LoadBalancerStatusOrder, where *LoadBalancerStatusWhereInput, -) (*LoadBalancerStatusConnection, error) { - opts := []LoadBalancerStatusPaginateOption{ - WithLoadBalancerStatusOrder(orderBy), - WithLoadBalancerStatusFilter(where.Filter), - } - alias := graphql.GetFieldContext(ctx).Field.Alias - totalCount, hasTotalCount := lb.Edges.totalCount[1][alias] - if nodes, err := lb.NamedStatuses(alias); err == nil || hasTotalCount { - pager, err := newLoadBalancerStatusPager(opts, last != nil) - if err != nil { - return nil, err - } - conn := &LoadBalancerStatusConnection{Edges: []*LoadBalancerStatusEdge{}, TotalCount: totalCount} - conn.build(nodes, pager, after, first, before, last) - return conn, nil - } - return lb.QueryStatuses().Paginate(ctx, after, first, before, last, opts...) -} - func (lb *LoadBalancer) Ports( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *LoadBalancerPortOrder, where *LoadBalancerPortWhereInput, ) (*LoadBalancerPortConnection, error) { @@ -62,7 +30,7 @@ func (lb *LoadBalancer) Ports( WithLoadBalancerPortFilter(where.Filter), } alias := graphql.GetFieldContext(ctx).Field.Alias - totalCount, hasTotalCount := lb.Edges.totalCount[2][alias] + totalCount, hasTotalCount := lb.Edges.totalCount[0][alias] if nodes, err := lb.NamedPorts(alias); err == nil || hasTotalCount { pager, err := newLoadBalancerPortPager(opts, last != nil) if err != nil { @@ -83,22 +51,6 @@ func (lb *LoadBalancer) Provider(ctx context.Context) (*Provider, error) { return result, err } -func (lba *LoadBalancerAnnotation) LoadBalancer(ctx context.Context) (*LoadBalancer, error) { - result, err := lba.Edges.LoadBalancerOrErr() - if IsNotLoaded(err) { - result, err = lba.QueryLoadBalancer().Only(ctx) - } - return result, err -} - -func (lbs *LoadBalancerStatus) LoadBalancer(ctx context.Context) (*LoadBalancer, error) { - result, err := lbs.Edges.LoadBalancerOrErr() - if IsNotLoaded(err) { - result, err = lbs.QueryLoadBalancer().Only(ctx) - } - return result, err -} - func (o *Origin) Pool(ctx context.Context) (*Pool, error) { result, err := o.Edges.PoolOrErr() if IsNotLoaded(err) { diff --git a/internal/ent/generated/gql_mutation_input.go b/internal/ent/generated/gql_mutation_input.go index de46bc266..326fb1711 100644 --- a/internal/ent/generated/gql_mutation_input.go +++ b/internal/ent/generated/gql_mutation_input.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/gql_node.go b/internal/ent/generated/gql_node.go index 910860071..322b30bcb 100644 --- a/internal/ent/generated/gql_node.go +++ b/internal/ent/generated/gql_node.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -14,8 +24,6 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/hashicorp/go-multierror" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "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" @@ -31,12 +39,6 @@ type Noder interface { // IsNode implements the Node interface check for GQLGen. func (n *LoadBalancer) IsNode() {} -// IsNode implements the Node interface check for GQLGen. -func (n *LoadBalancerAnnotation) IsNode() {} - -// IsNode implements the Node interface check for GQLGen. -func (n *LoadBalancerStatus) IsNode() {} - // IsNode implements the Node interface check for GQLGen. func (n *Origin) IsNode() {} @@ -123,38 +125,6 @@ func (c *Client) noder(ctx context.Context, table string, id gidx.PrefixedID) (N return nil, err } return n, nil - case loadbalancerannotation.Table: - var uid gidx.PrefixedID - if err := uid.UnmarshalGQL(id); err != nil { - return nil, err - } - query := c.LoadBalancerAnnotation.Query(). - Where(loadbalancerannotation.ID(uid)) - query, err := query.CollectFields(ctx, "LoadBalancerAnnotation") - if err != nil { - return nil, err - } - n, err := query.Only(ctx) - if err != nil { - return nil, err - } - return n, nil - case loadbalancerstatus.Table: - var uid gidx.PrefixedID - if err := uid.UnmarshalGQL(id); err != nil { - return nil, err - } - query := c.LoadBalancerStatus.Query(). - Where(loadbalancerstatus.ID(uid)) - query, err := query.CollectFields(ctx, "LoadBalancerStatus") - if err != nil { - return nil, err - } - n, err := query.Only(ctx) - if err != nil { - return nil, err - } - return n, nil case origin.Table: var uid gidx.PrefixedID if err := uid.UnmarshalGQL(id); err != nil { @@ -308,38 +278,6 @@ func (c *Client) noders(ctx context.Context, table string, ids []gidx.PrefixedID *noder = node } } - case loadbalancerannotation.Table: - query := c.LoadBalancerAnnotation.Query(). - Where(loadbalancerannotation.IDIn(ids...)) - query, err := query.CollectFields(ctx, "LoadBalancerAnnotation") - if err != nil { - return nil, err - } - nodes, err := query.All(ctx) - if err != nil { - return nil, err - } - for _, node := range nodes { - for _, noder := range idmap[node.ID] { - *noder = node - } - } - case loadbalancerstatus.Table: - query := c.LoadBalancerStatus.Query(). - Where(loadbalancerstatus.IDIn(ids...)) - query, err := query.CollectFields(ctx, "LoadBalancerStatus") - if err != nil { - return nil, err - } - nodes, err := query.All(ctx) - if err != nil { - return nil, err - } - for _, node := range nodes { - for _, noder := range idmap[node.ID] { - *noder = node - } - } case origin.Table: query := c.Origin.Query(). Where(origin.IDIn(ids...)) diff --git a/internal/ent/generated/gql_pagination.go b/internal/ent/generated/gql_pagination.go index c0414236a..29b377b81 100644 --- a/internal/ent/generated/gql_pagination.go +++ b/internal/ent/generated/gql_pagination.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -20,8 +30,6 @@ import ( "github.com/99designs/gqlgen/graphql/errcode" "github.com/vektah/gqlparser/v2/gqlerror" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "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" @@ -474,628 +482,6 @@ func (lb *LoadBalancer) ToEdge(order *LoadBalancerOrder) *LoadBalancerEdge { } } -// LoadBalancerAnnotationEdge is the edge representation of LoadBalancerAnnotation. -type LoadBalancerAnnotationEdge struct { - Node *LoadBalancerAnnotation `json:"node"` - Cursor Cursor `json:"cursor"` -} - -// LoadBalancerAnnotationConnection is the connection containing edges to LoadBalancerAnnotation. -type LoadBalancerAnnotationConnection struct { - Edges []*LoadBalancerAnnotationEdge `json:"edges"` - PageInfo PageInfo `json:"pageInfo"` - TotalCount int `json:"totalCount"` -} - -func (c *LoadBalancerAnnotationConnection) build(nodes []*LoadBalancerAnnotation, pager *loadbalancerannotationPager, after *Cursor, first *int, before *Cursor, last *int) { - c.PageInfo.HasNextPage = before != nil - c.PageInfo.HasPreviousPage = after != nil - if first != nil && *first+1 == len(nodes) { - c.PageInfo.HasNextPage = true - nodes = nodes[:len(nodes)-1] - } else if last != nil && *last+1 == len(nodes) { - c.PageInfo.HasPreviousPage = true - nodes = nodes[:len(nodes)-1] - } - var nodeAt func(int) *LoadBalancerAnnotation - if last != nil { - n := len(nodes) - 1 - nodeAt = func(i int) *LoadBalancerAnnotation { - return nodes[n-i] - } - } else { - nodeAt = func(i int) *LoadBalancerAnnotation { - return nodes[i] - } - } - c.Edges = make([]*LoadBalancerAnnotationEdge, len(nodes)) - for i := range nodes { - node := nodeAt(i) - c.Edges[i] = &LoadBalancerAnnotationEdge{ - Node: node, - Cursor: pager.toCursor(node), - } - } - if l := len(c.Edges); l > 0 { - c.PageInfo.StartCursor = &c.Edges[0].Cursor - c.PageInfo.EndCursor = &c.Edges[l-1].Cursor - } - if c.TotalCount == 0 { - c.TotalCount = len(nodes) - } -} - -// LoadBalancerAnnotationPaginateOption enables pagination customization. -type LoadBalancerAnnotationPaginateOption func(*loadbalancerannotationPager) error - -// WithLoadBalancerAnnotationOrder configures pagination ordering. -func WithLoadBalancerAnnotationOrder(order *LoadBalancerAnnotationOrder) LoadBalancerAnnotationPaginateOption { - if order == nil { - order = DefaultLoadBalancerAnnotationOrder - } - o := *order - return func(pager *loadbalancerannotationPager) error { - if err := o.Direction.Validate(); err != nil { - return err - } - if o.Field == nil { - o.Field = DefaultLoadBalancerAnnotationOrder.Field - } - pager.order = &o - return nil - } -} - -// WithLoadBalancerAnnotationFilter configures pagination filter. -func WithLoadBalancerAnnotationFilter(filter func(*LoadBalancerAnnotationQuery) (*LoadBalancerAnnotationQuery, error)) LoadBalancerAnnotationPaginateOption { - return func(pager *loadbalancerannotationPager) error { - if filter == nil { - return errors.New("LoadBalancerAnnotationQuery filter cannot be nil") - } - pager.filter = filter - return nil - } -} - -type loadbalancerannotationPager struct { - reverse bool - order *LoadBalancerAnnotationOrder - filter func(*LoadBalancerAnnotationQuery) (*LoadBalancerAnnotationQuery, error) -} - -func newLoadBalancerAnnotationPager(opts []LoadBalancerAnnotationPaginateOption, reverse bool) (*loadbalancerannotationPager, error) { - pager := &loadbalancerannotationPager{reverse: reverse} - for _, opt := range opts { - if err := opt(pager); err != nil { - return nil, err - } - } - if pager.order == nil { - pager.order = DefaultLoadBalancerAnnotationOrder - } - return pager, nil -} - -func (p *loadbalancerannotationPager) applyFilter(query *LoadBalancerAnnotationQuery) (*LoadBalancerAnnotationQuery, error) { - if p.filter != nil { - return p.filter(query) - } - return query, nil -} - -func (p *loadbalancerannotationPager) toCursor(lba *LoadBalancerAnnotation) Cursor { - return p.order.Field.toCursor(lba) -} - -func (p *loadbalancerannotationPager) applyCursors(query *LoadBalancerAnnotationQuery, after, before *Cursor) (*LoadBalancerAnnotationQuery, error) { - direction := p.order.Direction - if p.reverse { - direction = direction.Reverse() - } - for _, predicate := range entgql.CursorsPredicate(after, before, DefaultLoadBalancerAnnotationOrder.Field.column, p.order.Field.column, direction) { - query = query.Where(predicate) - } - return query, nil -} - -func (p *loadbalancerannotationPager) applyOrder(query *LoadBalancerAnnotationQuery) *LoadBalancerAnnotationQuery { - direction := p.order.Direction - if p.reverse { - direction = direction.Reverse() - } - query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) - if p.order.Field != DefaultLoadBalancerAnnotationOrder.Field { - query = query.Order(DefaultLoadBalancerAnnotationOrder.Field.toTerm(direction.OrderTermOption())) - } - if len(query.ctx.Fields) > 0 { - query.ctx.AppendFieldOnce(p.order.Field.column) - } - return query -} - -func (p *loadbalancerannotationPager) orderExpr(query *LoadBalancerAnnotationQuery) sql.Querier { - direction := p.order.Direction - if p.reverse { - direction = direction.Reverse() - } - if len(query.ctx.Fields) > 0 { - query.ctx.AppendFieldOnce(p.order.Field.column) - } - return sql.ExprFunc(func(b *sql.Builder) { - b.Ident(p.order.Field.column).Pad().WriteString(string(direction)) - if p.order.Field != DefaultLoadBalancerAnnotationOrder.Field { - b.Comma().Ident(DefaultLoadBalancerAnnotationOrder.Field.column).Pad().WriteString(string(direction)) - } - }) -} - -// Paginate executes the query and returns a relay based cursor connection to LoadBalancerAnnotation. -func (lba *LoadBalancerAnnotationQuery) Paginate( - ctx context.Context, after *Cursor, first *int, - before *Cursor, last *int, opts ...LoadBalancerAnnotationPaginateOption, -) (*LoadBalancerAnnotationConnection, error) { - if err := validateFirstLast(first, last); err != nil { - return nil, err - } - pager, err := newLoadBalancerAnnotationPager(opts, last != nil) - if err != nil { - return nil, err - } - if lba, err = pager.applyFilter(lba); err != nil { - return nil, err - } - conn := &LoadBalancerAnnotationConnection{Edges: []*LoadBalancerAnnotationEdge{}} - ignoredEdges := !hasCollectedField(ctx, edgesField) - if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { - hasPagination := after != nil || first != nil || before != nil || last != nil - if hasPagination || ignoredEdges { - if conn.TotalCount, err = lba.Clone().Count(ctx); err != nil { - return nil, err - } - conn.PageInfo.HasNextPage = first != nil && conn.TotalCount > 0 - conn.PageInfo.HasPreviousPage = last != nil && conn.TotalCount > 0 - } - } - if ignoredEdges || (first != nil && *first == 0) || (last != nil && *last == 0) { - return conn, nil - } - if lba, err = pager.applyCursors(lba, after, before); err != nil { - return nil, err - } - if limit := paginateLimit(first, last); limit != 0 { - lba.Limit(limit) - } - if field := collectedField(ctx, edgesField, nodeField); field != nil { - if err := lba.collectField(ctx, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { - return nil, err - } - } - lba = pager.applyOrder(lba) - nodes, err := lba.All(ctx) - if err != nil { - return nil, err - } - conn.build(nodes, pager, after, first, before, last) - return conn, nil -} - -var ( - // LoadBalancerAnnotationOrderFieldCreatedAt orders LoadBalancerAnnotation by created_at. - LoadBalancerAnnotationOrderFieldCreatedAt = &LoadBalancerAnnotationOrderField{ - Value: func(lba *LoadBalancerAnnotation) (ent.Value, error) { - return lba.CreatedAt, nil - }, - column: loadbalancerannotation.FieldCreatedAt, - toTerm: loadbalancerannotation.ByCreatedAt, - toCursor: func(lba *LoadBalancerAnnotation) Cursor { - return Cursor{ - ID: lba.ID, - Value: lba.CreatedAt, - } - }, - } - // LoadBalancerAnnotationOrderFieldUpdatedAt orders LoadBalancerAnnotation by updated_at. - LoadBalancerAnnotationOrderFieldUpdatedAt = &LoadBalancerAnnotationOrderField{ - Value: func(lba *LoadBalancerAnnotation) (ent.Value, error) { - return lba.UpdatedAt, nil - }, - column: loadbalancerannotation.FieldUpdatedAt, - toTerm: loadbalancerannotation.ByUpdatedAt, - toCursor: func(lba *LoadBalancerAnnotation) Cursor { - return Cursor{ - ID: lba.ID, - Value: lba.UpdatedAt, - } - }, - } -) - -// String implement fmt.Stringer interface. -func (f LoadBalancerAnnotationOrderField) String() string { - var str string - switch f.column { - case LoadBalancerAnnotationOrderFieldCreatedAt.column: - str = "CREATED_AT" - case LoadBalancerAnnotationOrderFieldUpdatedAt.column: - str = "UPDATED_AT" - } - return str -} - -// MarshalGQL implements graphql.Marshaler interface. -func (f LoadBalancerAnnotationOrderField) MarshalGQL(w io.Writer) { - io.WriteString(w, strconv.Quote(f.String())) -} - -// UnmarshalGQL implements graphql.Unmarshaler interface. -func (f *LoadBalancerAnnotationOrderField) UnmarshalGQL(v interface{}) error { - str, ok := v.(string) - if !ok { - return fmt.Errorf("LoadBalancerAnnotationOrderField %T must be a string", v) - } - switch str { - case "CREATED_AT": - *f = *LoadBalancerAnnotationOrderFieldCreatedAt - case "UPDATED_AT": - *f = *LoadBalancerAnnotationOrderFieldUpdatedAt - default: - return fmt.Errorf("%s is not a valid LoadBalancerAnnotationOrderField", str) - } - return nil -} - -// LoadBalancerAnnotationOrderField defines the ordering field of LoadBalancerAnnotation. -type LoadBalancerAnnotationOrderField struct { - // Value extracts the ordering value from the given LoadBalancerAnnotation. - Value func(*LoadBalancerAnnotation) (ent.Value, error) - column string // field or computed. - toTerm func(...sql.OrderTermOption) loadbalancerannotation.OrderOption - toCursor func(*LoadBalancerAnnotation) Cursor -} - -// LoadBalancerAnnotationOrder defines the ordering of LoadBalancerAnnotation. -type LoadBalancerAnnotationOrder struct { - Direction OrderDirection `json:"direction"` - Field *LoadBalancerAnnotationOrderField `json:"field"` -} - -// DefaultLoadBalancerAnnotationOrder is the default ordering of LoadBalancerAnnotation. -var DefaultLoadBalancerAnnotationOrder = &LoadBalancerAnnotationOrder{ - Direction: entgql.OrderDirectionAsc, - Field: &LoadBalancerAnnotationOrderField{ - Value: func(lba *LoadBalancerAnnotation) (ent.Value, error) { - return lba.ID, nil - }, - column: loadbalancerannotation.FieldID, - toTerm: loadbalancerannotation.ByID, - toCursor: func(lba *LoadBalancerAnnotation) Cursor { - return Cursor{ID: lba.ID} - }, - }, -} - -// ToEdge converts LoadBalancerAnnotation into LoadBalancerAnnotationEdge. -func (lba *LoadBalancerAnnotation) ToEdge(order *LoadBalancerAnnotationOrder) *LoadBalancerAnnotationEdge { - if order == nil { - order = DefaultLoadBalancerAnnotationOrder - } - return &LoadBalancerAnnotationEdge{ - Node: lba, - Cursor: order.Field.toCursor(lba), - } -} - -// LoadBalancerStatusEdge is the edge representation of LoadBalancerStatus. -type LoadBalancerStatusEdge struct { - Node *LoadBalancerStatus `json:"node"` - Cursor Cursor `json:"cursor"` -} - -// LoadBalancerStatusConnection is the connection containing edges to LoadBalancerStatus. -type LoadBalancerStatusConnection struct { - Edges []*LoadBalancerStatusEdge `json:"edges"` - PageInfo PageInfo `json:"pageInfo"` - TotalCount int `json:"totalCount"` -} - -func (c *LoadBalancerStatusConnection) build(nodes []*LoadBalancerStatus, pager *loadbalancerstatusPager, after *Cursor, first *int, before *Cursor, last *int) { - c.PageInfo.HasNextPage = before != nil - c.PageInfo.HasPreviousPage = after != nil - if first != nil && *first+1 == len(nodes) { - c.PageInfo.HasNextPage = true - nodes = nodes[:len(nodes)-1] - } else if last != nil && *last+1 == len(nodes) { - c.PageInfo.HasPreviousPage = true - nodes = nodes[:len(nodes)-1] - } - var nodeAt func(int) *LoadBalancerStatus - if last != nil { - n := len(nodes) - 1 - nodeAt = func(i int) *LoadBalancerStatus { - return nodes[n-i] - } - } else { - nodeAt = func(i int) *LoadBalancerStatus { - return nodes[i] - } - } - c.Edges = make([]*LoadBalancerStatusEdge, len(nodes)) - for i := range nodes { - node := nodeAt(i) - c.Edges[i] = &LoadBalancerStatusEdge{ - Node: node, - Cursor: pager.toCursor(node), - } - } - if l := len(c.Edges); l > 0 { - c.PageInfo.StartCursor = &c.Edges[0].Cursor - c.PageInfo.EndCursor = &c.Edges[l-1].Cursor - } - if c.TotalCount == 0 { - c.TotalCount = len(nodes) - } -} - -// LoadBalancerStatusPaginateOption enables pagination customization. -type LoadBalancerStatusPaginateOption func(*loadbalancerstatusPager) error - -// WithLoadBalancerStatusOrder configures pagination ordering. -func WithLoadBalancerStatusOrder(order *LoadBalancerStatusOrder) LoadBalancerStatusPaginateOption { - if order == nil { - order = DefaultLoadBalancerStatusOrder - } - o := *order - return func(pager *loadbalancerstatusPager) error { - if err := o.Direction.Validate(); err != nil { - return err - } - if o.Field == nil { - o.Field = DefaultLoadBalancerStatusOrder.Field - } - pager.order = &o - return nil - } -} - -// WithLoadBalancerStatusFilter configures pagination filter. -func WithLoadBalancerStatusFilter(filter func(*LoadBalancerStatusQuery) (*LoadBalancerStatusQuery, error)) LoadBalancerStatusPaginateOption { - return func(pager *loadbalancerstatusPager) error { - if filter == nil { - return errors.New("LoadBalancerStatusQuery filter cannot be nil") - } - pager.filter = filter - return nil - } -} - -type loadbalancerstatusPager struct { - reverse bool - order *LoadBalancerStatusOrder - filter func(*LoadBalancerStatusQuery) (*LoadBalancerStatusQuery, error) -} - -func newLoadBalancerStatusPager(opts []LoadBalancerStatusPaginateOption, reverse bool) (*loadbalancerstatusPager, error) { - pager := &loadbalancerstatusPager{reverse: reverse} - for _, opt := range opts { - if err := opt(pager); err != nil { - return nil, err - } - } - if pager.order == nil { - pager.order = DefaultLoadBalancerStatusOrder - } - return pager, nil -} - -func (p *loadbalancerstatusPager) applyFilter(query *LoadBalancerStatusQuery) (*LoadBalancerStatusQuery, error) { - if p.filter != nil { - return p.filter(query) - } - return query, nil -} - -func (p *loadbalancerstatusPager) toCursor(lbs *LoadBalancerStatus) Cursor { - return p.order.Field.toCursor(lbs) -} - -func (p *loadbalancerstatusPager) applyCursors(query *LoadBalancerStatusQuery, after, before *Cursor) (*LoadBalancerStatusQuery, error) { - direction := p.order.Direction - if p.reverse { - direction = direction.Reverse() - } - for _, predicate := range entgql.CursorsPredicate(after, before, DefaultLoadBalancerStatusOrder.Field.column, p.order.Field.column, direction) { - query = query.Where(predicate) - } - return query, nil -} - -func (p *loadbalancerstatusPager) applyOrder(query *LoadBalancerStatusQuery) *LoadBalancerStatusQuery { - direction := p.order.Direction - if p.reverse { - direction = direction.Reverse() - } - query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) - if p.order.Field != DefaultLoadBalancerStatusOrder.Field { - query = query.Order(DefaultLoadBalancerStatusOrder.Field.toTerm(direction.OrderTermOption())) - } - if len(query.ctx.Fields) > 0 { - query.ctx.AppendFieldOnce(p.order.Field.column) - } - return query -} - -func (p *loadbalancerstatusPager) orderExpr(query *LoadBalancerStatusQuery) sql.Querier { - direction := p.order.Direction - if p.reverse { - direction = direction.Reverse() - } - if len(query.ctx.Fields) > 0 { - query.ctx.AppendFieldOnce(p.order.Field.column) - } - return sql.ExprFunc(func(b *sql.Builder) { - b.Ident(p.order.Field.column).Pad().WriteString(string(direction)) - if p.order.Field != DefaultLoadBalancerStatusOrder.Field { - b.Comma().Ident(DefaultLoadBalancerStatusOrder.Field.column).Pad().WriteString(string(direction)) - } - }) -} - -// Paginate executes the query and returns a relay based cursor connection to LoadBalancerStatus. -func (lbs *LoadBalancerStatusQuery) Paginate( - ctx context.Context, after *Cursor, first *int, - before *Cursor, last *int, opts ...LoadBalancerStatusPaginateOption, -) (*LoadBalancerStatusConnection, error) { - if err := validateFirstLast(first, last); err != nil { - return nil, err - } - pager, err := newLoadBalancerStatusPager(opts, last != nil) - if err != nil { - return nil, err - } - if lbs, err = pager.applyFilter(lbs); err != nil { - return nil, err - } - conn := &LoadBalancerStatusConnection{Edges: []*LoadBalancerStatusEdge{}} - ignoredEdges := !hasCollectedField(ctx, edgesField) - if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { - hasPagination := after != nil || first != nil || before != nil || last != nil - if hasPagination || ignoredEdges { - if conn.TotalCount, err = lbs.Clone().Count(ctx); err != nil { - return nil, err - } - conn.PageInfo.HasNextPage = first != nil && conn.TotalCount > 0 - conn.PageInfo.HasPreviousPage = last != nil && conn.TotalCount > 0 - } - } - if ignoredEdges || (first != nil && *first == 0) || (last != nil && *last == 0) { - return conn, nil - } - if lbs, err = pager.applyCursors(lbs, after, before); err != nil { - return nil, err - } - if limit := paginateLimit(first, last); limit != 0 { - lbs.Limit(limit) - } - if field := collectedField(ctx, edgesField, nodeField); field != nil { - if err := lbs.collectField(ctx, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { - return nil, err - } - } - lbs = pager.applyOrder(lbs) - nodes, err := lbs.All(ctx) - if err != nil { - return nil, err - } - conn.build(nodes, pager, after, first, before, last) - return conn, nil -} - -var ( - // LoadBalancerStatusOrderFieldCreatedAt orders LoadBalancerStatus by created_at. - LoadBalancerStatusOrderFieldCreatedAt = &LoadBalancerStatusOrderField{ - Value: func(lbs *LoadBalancerStatus) (ent.Value, error) { - return lbs.CreatedAt, nil - }, - column: loadbalancerstatus.FieldCreatedAt, - toTerm: loadbalancerstatus.ByCreatedAt, - toCursor: func(lbs *LoadBalancerStatus) Cursor { - return Cursor{ - ID: lbs.ID, - Value: lbs.CreatedAt, - } - }, - } - // LoadBalancerStatusOrderFieldUpdatedAt orders LoadBalancerStatus by updated_at. - LoadBalancerStatusOrderFieldUpdatedAt = &LoadBalancerStatusOrderField{ - Value: func(lbs *LoadBalancerStatus) (ent.Value, error) { - return lbs.UpdatedAt, nil - }, - column: loadbalancerstatus.FieldUpdatedAt, - toTerm: loadbalancerstatus.ByUpdatedAt, - toCursor: func(lbs *LoadBalancerStatus) Cursor { - return Cursor{ - ID: lbs.ID, - Value: lbs.UpdatedAt, - } - }, - } -) - -// String implement fmt.Stringer interface. -func (f LoadBalancerStatusOrderField) String() string { - var str string - switch f.column { - case LoadBalancerStatusOrderFieldCreatedAt.column: - str = "CREATED_AT" - case LoadBalancerStatusOrderFieldUpdatedAt.column: - str = "UPDATED_AT" - } - return str -} - -// MarshalGQL implements graphql.Marshaler interface. -func (f LoadBalancerStatusOrderField) MarshalGQL(w io.Writer) { - io.WriteString(w, strconv.Quote(f.String())) -} - -// UnmarshalGQL implements graphql.Unmarshaler interface. -func (f *LoadBalancerStatusOrderField) UnmarshalGQL(v interface{}) error { - str, ok := v.(string) - if !ok { - return fmt.Errorf("LoadBalancerStatusOrderField %T must be a string", v) - } - switch str { - case "CREATED_AT": - *f = *LoadBalancerStatusOrderFieldCreatedAt - case "UPDATED_AT": - *f = *LoadBalancerStatusOrderFieldUpdatedAt - default: - return fmt.Errorf("%s is not a valid LoadBalancerStatusOrderField", str) - } - return nil -} - -// LoadBalancerStatusOrderField defines the ordering field of LoadBalancerStatus. -type LoadBalancerStatusOrderField struct { - // Value extracts the ordering value from the given LoadBalancerStatus. - Value func(*LoadBalancerStatus) (ent.Value, error) - column string // field or computed. - toTerm func(...sql.OrderTermOption) loadbalancerstatus.OrderOption - toCursor func(*LoadBalancerStatus) Cursor -} - -// LoadBalancerStatusOrder defines the ordering of LoadBalancerStatus. -type LoadBalancerStatusOrder struct { - Direction OrderDirection `json:"direction"` - Field *LoadBalancerStatusOrderField `json:"field"` -} - -// DefaultLoadBalancerStatusOrder is the default ordering of LoadBalancerStatus. -var DefaultLoadBalancerStatusOrder = &LoadBalancerStatusOrder{ - Direction: entgql.OrderDirectionAsc, - Field: &LoadBalancerStatusOrderField{ - Value: func(lbs *LoadBalancerStatus) (ent.Value, error) { - return lbs.ID, nil - }, - column: loadbalancerstatus.FieldID, - toTerm: loadbalancerstatus.ByID, - toCursor: func(lbs *LoadBalancerStatus) Cursor { - return Cursor{ID: lbs.ID} - }, - }, -} - -// ToEdge converts LoadBalancerStatus into LoadBalancerStatusEdge. -func (lbs *LoadBalancerStatus) ToEdge(order *LoadBalancerStatusOrder) *LoadBalancerStatusEdge { - if order == nil { - order = DefaultLoadBalancerStatusOrder - } - return &LoadBalancerStatusEdge{ - Node: lbs, - Cursor: order.Field.toCursor(lbs), - } -} - // LoadBalancerOrigin is the type alias for Origin. type LoadBalancerOrigin = Origin diff --git a/internal/ent/generated/gql_transaction.go b/internal/ent/generated/gql_transaction.go index a1ae4a071..64c8df84b 100644 --- a/internal/ent/generated/gql_transaction.go +++ b/internal/ent/generated/gql_transaction.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/gql_where_input.go b/internal/ent/generated/gql_where_input.go index 094c11b2a..c5c1ee66c 100644 --- a/internal/ent/generated/gql_where_input.go +++ b/internal/ent/generated/gql_where_input.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -12,8 +22,6 @@ import ( "time" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "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" @@ -74,14 +82,6 @@ type LoadBalancerWhereInput struct { NameEqualFold *string `json:"nameEqualFold,omitempty"` NameContainsFold *string `json:"nameContainsFold,omitempty"` - // "annotations" edge predicates. - HasAnnotations *bool `json:"hasAnnotations,omitempty"` - HasAnnotationsWith []*LoadBalancerAnnotationWhereInput `json:"hasAnnotationsWith,omitempty"` - - // "statuses" edge predicates. - HasStatuses *bool `json:"hasStatuses,omitempty"` - HasStatusesWith []*LoadBalancerStatusWhereInput `json:"hasStatusesWith,omitempty"` - // "ports" edge predicates. HasPorts *bool `json:"hasPorts,omitempty"` HasPortsWith []*LoadBalancerPortWhereInput `json:"hasPortsWith,omitempty"` @@ -274,42 +274,6 @@ func (i *LoadBalancerWhereInput) P() (predicate.LoadBalancer, error) { predicates = append(predicates, loadbalancer.NameContainsFold(*i.NameContainsFold)) } - if i.HasAnnotations != nil { - p := loadbalancer.HasAnnotations() - if !*i.HasAnnotations { - p = loadbalancer.Not(p) - } - predicates = append(predicates, p) - } - if len(i.HasAnnotationsWith) > 0 { - with := make([]predicate.LoadBalancerAnnotation, 0, len(i.HasAnnotationsWith)) - for _, w := range i.HasAnnotationsWith { - p, err := w.P() - if err != nil { - return nil, fmt.Errorf("%w: field 'HasAnnotationsWith'", err) - } - with = append(with, p) - } - predicates = append(predicates, loadbalancer.HasAnnotationsWith(with...)) - } - if i.HasStatuses != nil { - p := loadbalancer.HasStatuses() - if !*i.HasStatuses { - p = loadbalancer.Not(p) - } - predicates = append(predicates, p) - } - if len(i.HasStatusesWith) > 0 { - with := make([]predicate.LoadBalancerStatus, 0, len(i.HasStatusesWith)) - for _, w := range i.HasStatusesWith { - p, err := w.P() - if err != nil { - return nil, fmt.Errorf("%w: field 'HasStatusesWith'", err) - } - with = append(with, p) - } - predicates = append(predicates, loadbalancer.HasStatusesWith(with...)) - } if i.HasPorts != nil { p := loadbalancer.HasPorts() if !*i.HasPorts { @@ -356,488 +320,6 @@ func (i *LoadBalancerWhereInput) P() (predicate.LoadBalancer, error) { } } -// LoadBalancerAnnotationWhereInput represents a where input for filtering LoadBalancerAnnotation queries. -type LoadBalancerAnnotationWhereInput struct { - Predicates []predicate.LoadBalancerAnnotation `json:"-"` - Not *LoadBalancerAnnotationWhereInput `json:"not,omitempty"` - Or []*LoadBalancerAnnotationWhereInput `json:"or,omitempty"` - And []*LoadBalancerAnnotationWhereInput `json:"and,omitempty"` - - // "id" field predicates. - ID *gidx.PrefixedID `json:"id,omitempty"` - IDNEQ *gidx.PrefixedID `json:"idNEQ,omitempty"` - IDIn []gidx.PrefixedID `json:"idIn,omitempty"` - IDNotIn []gidx.PrefixedID `json:"idNotIn,omitempty"` - IDGT *gidx.PrefixedID `json:"idGT,omitempty"` - IDGTE *gidx.PrefixedID `json:"idGTE,omitempty"` - IDLT *gidx.PrefixedID `json:"idLT,omitempty"` - IDLTE *gidx.PrefixedID `json:"idLTE,omitempty"` - - // "created_at" field predicates. - CreatedAt *time.Time `json:"createdAt,omitempty"` - CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` - CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` - CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` - CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` - CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` - CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` - CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` - - // "updated_at" field predicates. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` - UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` - UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` - UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` - UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` - UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` - UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` - - // "load_balancer" edge predicates. - HasLoadBalancer *bool `json:"hasLoadBalancer,omitempty"` - HasLoadBalancerWith []*LoadBalancerWhereInput `json:"hasLoadBalancerWith,omitempty"` -} - -// AddPredicates adds custom predicates to the where input to be used during the filtering phase. -func (i *LoadBalancerAnnotationWhereInput) AddPredicates(predicates ...predicate.LoadBalancerAnnotation) { - i.Predicates = append(i.Predicates, predicates...) -} - -// Filter applies the LoadBalancerAnnotationWhereInput filter on the LoadBalancerAnnotationQuery builder. -func (i *LoadBalancerAnnotationWhereInput) Filter(q *LoadBalancerAnnotationQuery) (*LoadBalancerAnnotationQuery, error) { - if i == nil { - return q, nil - } - p, err := i.P() - if err != nil { - if err == ErrEmptyLoadBalancerAnnotationWhereInput { - return q, nil - } - return nil, err - } - return q.Where(p), nil -} - -// ErrEmptyLoadBalancerAnnotationWhereInput is returned in case the LoadBalancerAnnotationWhereInput is empty. -var ErrEmptyLoadBalancerAnnotationWhereInput = errors.New("generated: empty predicate LoadBalancerAnnotationWhereInput") - -// P returns a predicate for filtering loadbalancerannotations. -// An error is returned if the input is empty or invalid. -func (i *LoadBalancerAnnotationWhereInput) P() (predicate.LoadBalancerAnnotation, error) { - var predicates []predicate.LoadBalancerAnnotation - if i.Not != nil { - p, err := i.Not.P() - if err != nil { - return nil, fmt.Errorf("%w: field 'not'", err) - } - predicates = append(predicates, loadbalancerannotation.Not(p)) - } - switch n := len(i.Or); { - case n == 1: - p, err := i.Or[0].P() - if err != nil { - return nil, fmt.Errorf("%w: field 'or'", err) - } - predicates = append(predicates, p) - case n > 1: - or := make([]predicate.LoadBalancerAnnotation, 0, n) - for _, w := range i.Or { - p, err := w.P() - if err != nil { - return nil, fmt.Errorf("%w: field 'or'", err) - } - or = append(or, p) - } - predicates = append(predicates, loadbalancerannotation.Or(or...)) - } - switch n := len(i.And); { - case n == 1: - p, err := i.And[0].P() - if err != nil { - return nil, fmt.Errorf("%w: field 'and'", err) - } - predicates = append(predicates, p) - case n > 1: - and := make([]predicate.LoadBalancerAnnotation, 0, n) - for _, w := range i.And { - p, err := w.P() - if err != nil { - return nil, fmt.Errorf("%w: field 'and'", err) - } - and = append(and, p) - } - predicates = append(predicates, loadbalancerannotation.And(and...)) - } - predicates = append(predicates, i.Predicates...) - if i.ID != nil { - predicates = append(predicates, loadbalancerannotation.IDEQ(*i.ID)) - } - if i.IDNEQ != nil { - predicates = append(predicates, loadbalancerannotation.IDNEQ(*i.IDNEQ)) - } - if len(i.IDIn) > 0 { - predicates = append(predicates, loadbalancerannotation.IDIn(i.IDIn...)) - } - if len(i.IDNotIn) > 0 { - predicates = append(predicates, loadbalancerannotation.IDNotIn(i.IDNotIn...)) - } - if i.IDGT != nil { - predicates = append(predicates, loadbalancerannotation.IDGT(*i.IDGT)) - } - if i.IDGTE != nil { - predicates = append(predicates, loadbalancerannotation.IDGTE(*i.IDGTE)) - } - if i.IDLT != nil { - predicates = append(predicates, loadbalancerannotation.IDLT(*i.IDLT)) - } - if i.IDLTE != nil { - predicates = append(predicates, loadbalancerannotation.IDLTE(*i.IDLTE)) - } - if i.CreatedAt != nil { - predicates = append(predicates, loadbalancerannotation.CreatedAtEQ(*i.CreatedAt)) - } - if i.CreatedAtNEQ != nil { - predicates = append(predicates, loadbalancerannotation.CreatedAtNEQ(*i.CreatedAtNEQ)) - } - if len(i.CreatedAtIn) > 0 { - predicates = append(predicates, loadbalancerannotation.CreatedAtIn(i.CreatedAtIn...)) - } - if len(i.CreatedAtNotIn) > 0 { - predicates = append(predicates, loadbalancerannotation.CreatedAtNotIn(i.CreatedAtNotIn...)) - } - if i.CreatedAtGT != nil { - predicates = append(predicates, loadbalancerannotation.CreatedAtGT(*i.CreatedAtGT)) - } - if i.CreatedAtGTE != nil { - predicates = append(predicates, loadbalancerannotation.CreatedAtGTE(*i.CreatedAtGTE)) - } - if i.CreatedAtLT != nil { - predicates = append(predicates, loadbalancerannotation.CreatedAtLT(*i.CreatedAtLT)) - } - if i.CreatedAtLTE != nil { - predicates = append(predicates, loadbalancerannotation.CreatedAtLTE(*i.CreatedAtLTE)) - } - if i.UpdatedAt != nil { - predicates = append(predicates, loadbalancerannotation.UpdatedAtEQ(*i.UpdatedAt)) - } - if i.UpdatedAtNEQ != nil { - predicates = append(predicates, loadbalancerannotation.UpdatedAtNEQ(*i.UpdatedAtNEQ)) - } - if len(i.UpdatedAtIn) > 0 { - predicates = append(predicates, loadbalancerannotation.UpdatedAtIn(i.UpdatedAtIn...)) - } - if len(i.UpdatedAtNotIn) > 0 { - predicates = append(predicates, loadbalancerannotation.UpdatedAtNotIn(i.UpdatedAtNotIn...)) - } - if i.UpdatedAtGT != nil { - predicates = append(predicates, loadbalancerannotation.UpdatedAtGT(*i.UpdatedAtGT)) - } - if i.UpdatedAtGTE != nil { - predicates = append(predicates, loadbalancerannotation.UpdatedAtGTE(*i.UpdatedAtGTE)) - } - if i.UpdatedAtLT != nil { - predicates = append(predicates, loadbalancerannotation.UpdatedAtLT(*i.UpdatedAtLT)) - } - if i.UpdatedAtLTE != nil { - predicates = append(predicates, loadbalancerannotation.UpdatedAtLTE(*i.UpdatedAtLTE)) - } - - if i.HasLoadBalancer != nil { - p := loadbalancerannotation.HasLoadBalancer() - if !*i.HasLoadBalancer { - p = loadbalancerannotation.Not(p) - } - predicates = append(predicates, p) - } - if len(i.HasLoadBalancerWith) > 0 { - with := make([]predicate.LoadBalancer, 0, len(i.HasLoadBalancerWith)) - for _, w := range i.HasLoadBalancerWith { - p, err := w.P() - if err != nil { - return nil, fmt.Errorf("%w: field 'HasLoadBalancerWith'", err) - } - with = append(with, p) - } - predicates = append(predicates, loadbalancerannotation.HasLoadBalancerWith(with...)) - } - switch len(predicates) { - case 0: - return nil, ErrEmptyLoadBalancerAnnotationWhereInput - case 1: - return predicates[0], nil - default: - return loadbalancerannotation.And(predicates...), nil - } -} - -// LoadBalancerStatusWhereInput represents a where input for filtering LoadBalancerStatus queries. -type LoadBalancerStatusWhereInput struct { - Predicates []predicate.LoadBalancerStatus `json:"-"` - Not *LoadBalancerStatusWhereInput `json:"not,omitempty"` - Or []*LoadBalancerStatusWhereInput `json:"or,omitempty"` - And []*LoadBalancerStatusWhereInput `json:"and,omitempty"` - - // "id" field predicates. - ID *gidx.PrefixedID `json:"id,omitempty"` - IDNEQ *gidx.PrefixedID `json:"idNEQ,omitempty"` - IDIn []gidx.PrefixedID `json:"idIn,omitempty"` - IDNotIn []gidx.PrefixedID `json:"idNotIn,omitempty"` - IDGT *gidx.PrefixedID `json:"idGT,omitempty"` - IDGTE *gidx.PrefixedID `json:"idGTE,omitempty"` - IDLT *gidx.PrefixedID `json:"idLT,omitempty"` - IDLTE *gidx.PrefixedID `json:"idLTE,omitempty"` - - // "created_at" field predicates. - CreatedAt *time.Time `json:"createdAt,omitempty"` - CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` - CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` - CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` - CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` - CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` - CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` - CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` - - // "updated_at" field predicates. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` - UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` - UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` - UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` - UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` - UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` - UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` - - // "source" field predicates. - Source *string `json:"source,omitempty"` - SourceNEQ *string `json:"sourceNEQ,omitempty"` - SourceIn []string `json:"sourceIn,omitempty"` - SourceNotIn []string `json:"sourceNotIn,omitempty"` - SourceGT *string `json:"sourceGT,omitempty"` - SourceGTE *string `json:"sourceGTE,omitempty"` - SourceLT *string `json:"sourceLT,omitempty"` - SourceLTE *string `json:"sourceLTE,omitempty"` - SourceContains *string `json:"sourceContains,omitempty"` - SourceHasPrefix *string `json:"sourceHasPrefix,omitempty"` - SourceHasSuffix *string `json:"sourceHasSuffix,omitempty"` - SourceEqualFold *string `json:"sourceEqualFold,omitempty"` - SourceContainsFold *string `json:"sourceContainsFold,omitempty"` - - // "load_balancer" edge predicates. - HasLoadBalancer *bool `json:"hasLoadBalancer,omitempty"` - HasLoadBalancerWith []*LoadBalancerWhereInput `json:"hasLoadBalancerWith,omitempty"` -} - -// AddPredicates adds custom predicates to the where input to be used during the filtering phase. -func (i *LoadBalancerStatusWhereInput) AddPredicates(predicates ...predicate.LoadBalancerStatus) { - i.Predicates = append(i.Predicates, predicates...) -} - -// Filter applies the LoadBalancerStatusWhereInput filter on the LoadBalancerStatusQuery builder. -func (i *LoadBalancerStatusWhereInput) Filter(q *LoadBalancerStatusQuery) (*LoadBalancerStatusQuery, error) { - if i == nil { - return q, nil - } - p, err := i.P() - if err != nil { - if err == ErrEmptyLoadBalancerStatusWhereInput { - return q, nil - } - return nil, err - } - return q.Where(p), nil -} - -// ErrEmptyLoadBalancerStatusWhereInput is returned in case the LoadBalancerStatusWhereInput is empty. -var ErrEmptyLoadBalancerStatusWhereInput = errors.New("generated: empty predicate LoadBalancerStatusWhereInput") - -// P returns a predicate for filtering loadbalancerstatusslice. -// An error is returned if the input is empty or invalid. -func (i *LoadBalancerStatusWhereInput) P() (predicate.LoadBalancerStatus, error) { - var predicates []predicate.LoadBalancerStatus - if i.Not != nil { - p, err := i.Not.P() - if err != nil { - return nil, fmt.Errorf("%w: field 'not'", err) - } - predicates = append(predicates, loadbalancerstatus.Not(p)) - } - switch n := len(i.Or); { - case n == 1: - p, err := i.Or[0].P() - if err != nil { - return nil, fmt.Errorf("%w: field 'or'", err) - } - predicates = append(predicates, p) - case n > 1: - or := make([]predicate.LoadBalancerStatus, 0, n) - for _, w := range i.Or { - p, err := w.P() - if err != nil { - return nil, fmt.Errorf("%w: field 'or'", err) - } - or = append(or, p) - } - predicates = append(predicates, loadbalancerstatus.Or(or...)) - } - switch n := len(i.And); { - case n == 1: - p, err := i.And[0].P() - if err != nil { - return nil, fmt.Errorf("%w: field 'and'", err) - } - predicates = append(predicates, p) - case n > 1: - and := make([]predicate.LoadBalancerStatus, 0, n) - for _, w := range i.And { - p, err := w.P() - if err != nil { - return nil, fmt.Errorf("%w: field 'and'", err) - } - and = append(and, p) - } - predicates = append(predicates, loadbalancerstatus.And(and...)) - } - predicates = append(predicates, i.Predicates...) - if i.ID != nil { - predicates = append(predicates, loadbalancerstatus.IDEQ(*i.ID)) - } - if i.IDNEQ != nil { - predicates = append(predicates, loadbalancerstatus.IDNEQ(*i.IDNEQ)) - } - if len(i.IDIn) > 0 { - predicates = append(predicates, loadbalancerstatus.IDIn(i.IDIn...)) - } - if len(i.IDNotIn) > 0 { - predicates = append(predicates, loadbalancerstatus.IDNotIn(i.IDNotIn...)) - } - if i.IDGT != nil { - predicates = append(predicates, loadbalancerstatus.IDGT(*i.IDGT)) - } - if i.IDGTE != nil { - predicates = append(predicates, loadbalancerstatus.IDGTE(*i.IDGTE)) - } - if i.IDLT != nil { - predicates = append(predicates, loadbalancerstatus.IDLT(*i.IDLT)) - } - if i.IDLTE != nil { - predicates = append(predicates, loadbalancerstatus.IDLTE(*i.IDLTE)) - } - if i.CreatedAt != nil { - predicates = append(predicates, loadbalancerstatus.CreatedAtEQ(*i.CreatedAt)) - } - if i.CreatedAtNEQ != nil { - predicates = append(predicates, loadbalancerstatus.CreatedAtNEQ(*i.CreatedAtNEQ)) - } - if len(i.CreatedAtIn) > 0 { - predicates = append(predicates, loadbalancerstatus.CreatedAtIn(i.CreatedAtIn...)) - } - if len(i.CreatedAtNotIn) > 0 { - predicates = append(predicates, loadbalancerstatus.CreatedAtNotIn(i.CreatedAtNotIn...)) - } - if i.CreatedAtGT != nil { - predicates = append(predicates, loadbalancerstatus.CreatedAtGT(*i.CreatedAtGT)) - } - if i.CreatedAtGTE != nil { - predicates = append(predicates, loadbalancerstatus.CreatedAtGTE(*i.CreatedAtGTE)) - } - if i.CreatedAtLT != nil { - predicates = append(predicates, loadbalancerstatus.CreatedAtLT(*i.CreatedAtLT)) - } - if i.CreatedAtLTE != nil { - predicates = append(predicates, loadbalancerstatus.CreatedAtLTE(*i.CreatedAtLTE)) - } - if i.UpdatedAt != nil { - predicates = append(predicates, loadbalancerstatus.UpdatedAtEQ(*i.UpdatedAt)) - } - if i.UpdatedAtNEQ != nil { - predicates = append(predicates, loadbalancerstatus.UpdatedAtNEQ(*i.UpdatedAtNEQ)) - } - if len(i.UpdatedAtIn) > 0 { - predicates = append(predicates, loadbalancerstatus.UpdatedAtIn(i.UpdatedAtIn...)) - } - if len(i.UpdatedAtNotIn) > 0 { - predicates = append(predicates, loadbalancerstatus.UpdatedAtNotIn(i.UpdatedAtNotIn...)) - } - if i.UpdatedAtGT != nil { - predicates = append(predicates, loadbalancerstatus.UpdatedAtGT(*i.UpdatedAtGT)) - } - if i.UpdatedAtGTE != nil { - predicates = append(predicates, loadbalancerstatus.UpdatedAtGTE(*i.UpdatedAtGTE)) - } - if i.UpdatedAtLT != nil { - predicates = append(predicates, loadbalancerstatus.UpdatedAtLT(*i.UpdatedAtLT)) - } - if i.UpdatedAtLTE != nil { - predicates = append(predicates, loadbalancerstatus.UpdatedAtLTE(*i.UpdatedAtLTE)) - } - if i.Source != nil { - predicates = append(predicates, loadbalancerstatus.SourceEQ(*i.Source)) - } - if i.SourceNEQ != nil { - predicates = append(predicates, loadbalancerstatus.SourceNEQ(*i.SourceNEQ)) - } - if len(i.SourceIn) > 0 { - predicates = append(predicates, loadbalancerstatus.SourceIn(i.SourceIn...)) - } - if len(i.SourceNotIn) > 0 { - predicates = append(predicates, loadbalancerstatus.SourceNotIn(i.SourceNotIn...)) - } - if i.SourceGT != nil { - predicates = append(predicates, loadbalancerstatus.SourceGT(*i.SourceGT)) - } - if i.SourceGTE != nil { - predicates = append(predicates, loadbalancerstatus.SourceGTE(*i.SourceGTE)) - } - if i.SourceLT != nil { - predicates = append(predicates, loadbalancerstatus.SourceLT(*i.SourceLT)) - } - if i.SourceLTE != nil { - predicates = append(predicates, loadbalancerstatus.SourceLTE(*i.SourceLTE)) - } - if i.SourceContains != nil { - predicates = append(predicates, loadbalancerstatus.SourceContains(*i.SourceContains)) - } - if i.SourceHasPrefix != nil { - predicates = append(predicates, loadbalancerstatus.SourceHasPrefix(*i.SourceHasPrefix)) - } - if i.SourceHasSuffix != nil { - predicates = append(predicates, loadbalancerstatus.SourceHasSuffix(*i.SourceHasSuffix)) - } - if i.SourceEqualFold != nil { - predicates = append(predicates, loadbalancerstatus.SourceEqualFold(*i.SourceEqualFold)) - } - if i.SourceContainsFold != nil { - predicates = append(predicates, loadbalancerstatus.SourceContainsFold(*i.SourceContainsFold)) - } - - if i.HasLoadBalancer != nil { - p := loadbalancerstatus.HasLoadBalancer() - if !*i.HasLoadBalancer { - p = loadbalancerstatus.Not(p) - } - predicates = append(predicates, p) - } - if len(i.HasLoadBalancerWith) > 0 { - with := make([]predicate.LoadBalancer, 0, len(i.HasLoadBalancerWith)) - for _, w := range i.HasLoadBalancerWith { - p, err := w.P() - if err != nil { - return nil, fmt.Errorf("%w: field 'HasLoadBalancerWith'", err) - } - with = append(with, p) - } - predicates = append(predicates, loadbalancerstatus.HasLoadBalancerWith(with...)) - } - switch len(predicates) { - case 0: - return nil, ErrEmptyLoadBalancerStatusWhereInput - case 1: - return predicates[0], nil - default: - return loadbalancerstatus.And(predicates...), nil - } -} - // LoadBalancerOriginWhereInput represents a where input for filtering Origin queries. type LoadBalancerOriginWhereInput struct { Predicates []predicate.Origin `json:"-"` diff --git a/internal/ent/generated/hook/hook.go b/internal/ent/generated/hook/hook.go index 00ba00937..7e18dd375 100644 --- a/internal/ent/generated/hook/hook.go +++ b/internal/ent/generated/hook/hook.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -25,30 +35,6 @@ func (f LoadBalancerFunc) Mutate(ctx context.Context, m generated.Mutation) (gen return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.LoadBalancerMutation", m) } -// The LoadBalancerAnnotationFunc type is an adapter to allow the use of ordinary -// function as LoadBalancerAnnotation mutator. -type LoadBalancerAnnotationFunc func(context.Context, *generated.LoadBalancerAnnotationMutation) (generated.Value, error) - -// Mutate calls f(ctx, m). -func (f LoadBalancerAnnotationFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { - if mv, ok := m.(*generated.LoadBalancerAnnotationMutation); ok { - return f(ctx, mv) - } - return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.LoadBalancerAnnotationMutation", m) -} - -// The LoadBalancerStatusFunc type is an adapter to allow the use of ordinary -// function as LoadBalancerStatus mutator. -type LoadBalancerStatusFunc func(context.Context, *generated.LoadBalancerStatusMutation) (generated.Value, error) - -// Mutate calls f(ctx, m). -func (f LoadBalancerStatusFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { - if mv, ok := m.(*generated.LoadBalancerStatusMutation); ok { - return f(ctx, mv) - } - return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.LoadBalancerStatusMutation", m) -} - // The OriginFunc type is an adapter to allow the use of ordinary // function as Origin mutator. type OriginFunc func(context.Context, *generated.OriginMutation) (generated.Value, error) diff --git a/internal/ent/generated/intercept/intercept.go b/internal/ent/generated/intercept/intercept.go index 230a762e6..1267e2980 100644 --- a/internal/ent/generated/intercept/intercept.go +++ b/internal/ent/generated/intercept/intercept.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -13,8 +23,6 @@ import ( "entgo.io/ent/dialect/sql" "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/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "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" @@ -105,60 +113,6 @@ func (f TraverseLoadBalancer) Traverse(ctx context.Context, q generated.Query) e return fmt.Errorf("unexpected query type %T. expect *generated.LoadBalancerQuery", q) } -// The LoadBalancerAnnotationFunc type is an adapter to allow the use of ordinary function as a Querier. -type LoadBalancerAnnotationFunc func(context.Context, *generated.LoadBalancerAnnotationQuery) (generated.Value, error) - -// Query calls f(ctx, q). -func (f LoadBalancerAnnotationFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { - if q, ok := q.(*generated.LoadBalancerAnnotationQuery); ok { - return f(ctx, q) - } - return nil, fmt.Errorf("unexpected query type %T. expect *generated.LoadBalancerAnnotationQuery", q) -} - -// The TraverseLoadBalancerAnnotation type is an adapter to allow the use of ordinary function as Traverser. -type TraverseLoadBalancerAnnotation func(context.Context, *generated.LoadBalancerAnnotationQuery) error - -// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. -func (f TraverseLoadBalancerAnnotation) Intercept(next generated.Querier) generated.Querier { - return next -} - -// Traverse calls f(ctx, q). -func (f TraverseLoadBalancerAnnotation) Traverse(ctx context.Context, q generated.Query) error { - if q, ok := q.(*generated.LoadBalancerAnnotationQuery); ok { - return f(ctx, q) - } - return fmt.Errorf("unexpected query type %T. expect *generated.LoadBalancerAnnotationQuery", q) -} - -// The LoadBalancerStatusFunc type is an adapter to allow the use of ordinary function as a Querier. -type LoadBalancerStatusFunc func(context.Context, *generated.LoadBalancerStatusQuery) (generated.Value, error) - -// Query calls f(ctx, q). -func (f LoadBalancerStatusFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { - if q, ok := q.(*generated.LoadBalancerStatusQuery); ok { - return f(ctx, q) - } - return nil, fmt.Errorf("unexpected query type %T. expect *generated.LoadBalancerStatusQuery", q) -} - -// The TraverseLoadBalancerStatus type is an adapter to allow the use of ordinary function as Traverser. -type TraverseLoadBalancerStatus func(context.Context, *generated.LoadBalancerStatusQuery) error - -// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. -func (f TraverseLoadBalancerStatus) Intercept(next generated.Querier) generated.Querier { - return next -} - -// Traverse calls f(ctx, q). -func (f TraverseLoadBalancerStatus) Traverse(ctx context.Context, q generated.Query) error { - if q, ok := q.(*generated.LoadBalancerStatusQuery); ok { - return f(ctx, q) - } - return fmt.Errorf("unexpected query type %T. expect *generated.LoadBalancerStatusQuery", q) -} - // The OriginFunc type is an adapter to allow the use of ordinary function as a Querier. type OriginFunc func(context.Context, *generated.OriginQuery) (generated.Value, error) @@ -272,10 +226,6 @@ func NewQuery(q generated.Query) (Query, error) { switch q := q.(type) { case *generated.LoadBalancerQuery: return &query[*generated.LoadBalancerQuery, predicate.LoadBalancer, loadbalancer.OrderOption]{typ: generated.TypeLoadBalancer, tq: q}, nil - case *generated.LoadBalancerAnnotationQuery: - return &query[*generated.LoadBalancerAnnotationQuery, predicate.LoadBalancerAnnotation, loadbalancerannotation.OrderOption]{typ: generated.TypeLoadBalancerAnnotation, tq: q}, nil - case *generated.LoadBalancerStatusQuery: - return &query[*generated.LoadBalancerStatusQuery, predicate.LoadBalancerStatus, loadbalancerstatus.OrderOption]{typ: generated.TypeLoadBalancerStatus, tq: q}, nil case *generated.OriginQuery: return &query[*generated.OriginQuery, predicate.Origin, origin.OrderOption]{typ: generated.TypeOrigin, tq: q}, nil case *generated.PoolQuery: diff --git a/internal/ent/generated/ip_addressable.go b/internal/ent/generated/ip_addressable.go index 9acf87604..eedc1b96e 100644 --- a/internal/ent/generated/ip_addressable.go +++ b/internal/ent/generated/ip_addressable.go @@ -1,15 +1,21 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. package generated -type IPv4Addressable interface { - IsIPv4Addressable() -} - -type IPv6Addressable interface { - IsIPv6Addressable() +type IPAddressable interface { + IsIPAddressable() } diff --git a/internal/ent/generated/loadbalancer.go b/internal/ent/generated/loadbalancer.go index 373622909..cbd591e2c 100644 --- a/internal/ent/generated/loadbalancer.go +++ b/internal/ent/generated/loadbalancer.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -44,47 +54,23 @@ type LoadBalancer struct { // LoadBalancerEdges holds the relations/edges for other nodes in the graph. type LoadBalancerEdges struct { - // Annotations for the load balancer. - Annotations []*LoadBalancerAnnotation `json:"annotations,omitempty"` - // Statuses for the load balancer. - Statuses []*LoadBalancerStatus `json:"statuses,omitempty"` // Ports holds the value of the ports edge. Ports []*Port `json:"ports,omitempty"` // The load balancer provider for the load balancer. Provider *Provider `json:"provider,omitempty"` // loadedTypes holds the information for reporting if a // type was loaded (or requested) in eager-loading or not. - loadedTypes [4]bool + loadedTypes [2]bool // totalCount holds the count of the edges above. - totalCount [4]map[string]int + totalCount [2]map[string]int - namedAnnotations map[string][]*LoadBalancerAnnotation - namedStatuses map[string][]*LoadBalancerStatus - namedPorts map[string][]*Port -} - -// AnnotationsOrErr returns the Annotations value or an error if the edge -// was not loaded in eager-loading. -func (e LoadBalancerEdges) AnnotationsOrErr() ([]*LoadBalancerAnnotation, error) { - if e.loadedTypes[0] { - return e.Annotations, nil - } - return nil, &NotLoadedError{edge: "annotations"} -} - -// StatusesOrErr returns the Statuses value or an error if the edge -// was not loaded in eager-loading. -func (e LoadBalancerEdges) StatusesOrErr() ([]*LoadBalancerStatus, error) { - if e.loadedTypes[1] { - return e.Statuses, nil - } - return nil, &NotLoadedError{edge: "statuses"} + namedPorts map[string][]*Port } // PortsOrErr returns the Ports value or an error if the edge // was not loaded in eager-loading. func (e LoadBalancerEdges) PortsOrErr() ([]*Port, error) { - if e.loadedTypes[2] { + if e.loadedTypes[0] { return e.Ports, nil } return nil, &NotLoadedError{edge: "ports"} @@ -93,7 +79,7 @@ func (e LoadBalancerEdges) PortsOrErr() ([]*Port, error) { // ProviderOrErr returns the Provider value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. func (e LoadBalancerEdges) ProviderOrErr() (*Provider, error) { - if e.loadedTypes[3] { + if e.loadedTypes[1] { if e.Provider == nil { // Edge was loaded but was not found. return nil, &NotFoundError{label: provider.Label} @@ -184,16 +170,6 @@ func (lb *LoadBalancer) Value(name string) (ent.Value, error) { return lb.selectValues.Get(name) } -// QueryAnnotations queries the "annotations" edge of the LoadBalancer entity. -func (lb *LoadBalancer) QueryAnnotations() *LoadBalancerAnnotationQuery { - return NewLoadBalancerClient(lb.config).QueryAnnotations(lb) -} - -// QueryStatuses queries the "statuses" edge of the LoadBalancer entity. -func (lb *LoadBalancer) QueryStatuses() *LoadBalancerStatusQuery { - return NewLoadBalancerClient(lb.config).QueryStatuses(lb) -} - // QueryPorts queries the "ports" edge of the LoadBalancer entity. func (lb *LoadBalancer) QueryPorts() *PortQuery { return NewLoadBalancerClient(lb.config).QueryPorts(lb) @@ -251,56 +227,8 @@ func (lb *LoadBalancer) String() string { // IsEntity implement fedruntime.Entity func (lb LoadBalancer) IsEntity() {} -// IsIPv4Addressable implements interface for IPv4Addressable -func (lb LoadBalancer) IsIPv4Addressable() {} - -// NamedAnnotations returns the Annotations named value or an error if the edge was not -// loaded in eager-loading with this name. -func (lb *LoadBalancer) NamedAnnotations(name string) ([]*LoadBalancerAnnotation, error) { - if lb.Edges.namedAnnotations == nil { - return nil, &NotLoadedError{edge: name} - } - nodes, ok := lb.Edges.namedAnnotations[name] - if !ok { - return nil, &NotLoadedError{edge: name} - } - return nodes, nil -} - -func (lb *LoadBalancer) appendNamedAnnotations(name string, edges ...*LoadBalancerAnnotation) { - if lb.Edges.namedAnnotations == nil { - lb.Edges.namedAnnotations = make(map[string][]*LoadBalancerAnnotation) - } - if len(edges) == 0 { - lb.Edges.namedAnnotations[name] = []*LoadBalancerAnnotation{} - } else { - lb.Edges.namedAnnotations[name] = append(lb.Edges.namedAnnotations[name], edges...) - } -} - -// NamedStatuses returns the Statuses named value or an error if the edge was not -// loaded in eager-loading with this name. -func (lb *LoadBalancer) NamedStatuses(name string) ([]*LoadBalancerStatus, error) { - if lb.Edges.namedStatuses == nil { - return nil, &NotLoadedError{edge: name} - } - nodes, ok := lb.Edges.namedStatuses[name] - if !ok { - return nil, &NotLoadedError{edge: name} - } - return nodes, nil -} - -func (lb *LoadBalancer) appendNamedStatuses(name string, edges ...*LoadBalancerStatus) { - if lb.Edges.namedStatuses == nil { - lb.Edges.namedStatuses = make(map[string][]*LoadBalancerStatus) - } - if len(edges) == 0 { - lb.Edges.namedStatuses[name] = []*LoadBalancerStatus{} - } else { - lb.Edges.namedStatuses[name] = append(lb.Edges.namedStatuses[name], edges...) - } -} +// IsIPAddressable implements interface for IPAddressable +func (lb LoadBalancer) IsIPAddressable() {} // NamedPorts returns the Ports named value or an error if the edge was not // loaded in eager-loading with this name. diff --git a/internal/ent/generated/loadbalancer/loadbalancer.go b/internal/ent/generated/loadbalancer/loadbalancer.go index a63f561bb..51f94bdcb 100644 --- a/internal/ent/generated/loadbalancer/loadbalancer.go +++ b/internal/ent/generated/loadbalancer/loadbalancer.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -31,30 +41,12 @@ const ( FieldLocationID = "location_id" // FieldProviderID holds the string denoting the provider_id field in the database. FieldProviderID = "provider_id" - // EdgeAnnotations holds the string denoting the annotations edge name in mutations. - EdgeAnnotations = "annotations" - // EdgeStatuses holds the string denoting the statuses edge name in mutations. - EdgeStatuses = "statuses" // EdgePorts holds the string denoting the ports edge name in mutations. EdgePorts = "ports" // EdgeProvider holds the string denoting the provider edge name in mutations. EdgeProvider = "provider" // Table holds the table name of the loadbalancer in the database. Table = "load_balancers" - // AnnotationsTable is the table that holds the annotations relation/edge. - AnnotationsTable = "load_balancer_annotations" - // AnnotationsInverseTable is the table name for the LoadBalancerAnnotation entity. - // It exists in this package in order to avoid circular dependency with the "loadbalancerannotation" package. - AnnotationsInverseTable = "load_balancer_annotations" - // AnnotationsColumn is the table column denoting the annotations relation/edge. - AnnotationsColumn = "load_balancer_id" - // StatusesTable is the table that holds the statuses relation/edge. - StatusesTable = "load_balancer_status" - // StatusesInverseTable is the table name for the LoadBalancerStatus entity. - // It exists in this package in order to avoid circular dependency with the "loadbalancerstatus" package. - StatusesInverseTable = "load_balancer_status" - // StatusesColumn is the table column denoting the statuses relation/edge. - StatusesColumn = "load_balancer_id" // PortsTable is the table that holds the ports relation/edge. PortsTable = "ports" // PortsInverseTable is the table name for the Port entity. @@ -147,34 +139,6 @@ func ByProviderID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldProviderID, opts...).ToFunc() } -// ByAnnotationsCount orders the results by annotations count. -func ByAnnotationsCount(opts ...sql.OrderTermOption) OrderOption { - return func(s *sql.Selector) { - sqlgraph.OrderByNeighborsCount(s, newAnnotationsStep(), opts...) - } -} - -// ByAnnotations orders the results by annotations terms. -func ByAnnotations(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { - return func(s *sql.Selector) { - sqlgraph.OrderByNeighborTerms(s, newAnnotationsStep(), append([]sql.OrderTerm{term}, terms...)...) - } -} - -// ByStatusesCount orders the results by statuses count. -func ByStatusesCount(opts ...sql.OrderTermOption) OrderOption { - return func(s *sql.Selector) { - sqlgraph.OrderByNeighborsCount(s, newStatusesStep(), opts...) - } -} - -// ByStatuses orders the results by statuses terms. -func ByStatuses(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { - return func(s *sql.Selector) { - sqlgraph.OrderByNeighborTerms(s, newStatusesStep(), append([]sql.OrderTerm{term}, terms...)...) - } -} - // ByPortsCount orders the results by ports count. func ByPortsCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { @@ -195,20 +159,6 @@ func ByProviderField(field string, opts ...sql.OrderTermOption) OrderOption { sqlgraph.OrderByNeighborTerms(s, newProviderStep(), sql.OrderByField(field, opts...)) } } -func newAnnotationsStep() *sqlgraph.Step { - return sqlgraph.NewStep( - sqlgraph.From(Table, FieldID), - sqlgraph.To(AnnotationsInverseTable, FieldID), - sqlgraph.Edge(sqlgraph.O2M, true, AnnotationsTable, AnnotationsColumn), - ) -} -func newStatusesStep() *sqlgraph.Step { - return sqlgraph.NewStep( - sqlgraph.From(Table, FieldID), - sqlgraph.To(StatusesInverseTable, FieldID), - sqlgraph.Edge(sqlgraph.O2M, true, StatusesTable, StatusesColumn), - ) -} func newPortsStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), diff --git a/internal/ent/generated/loadbalancer/where.go b/internal/ent/generated/loadbalancer/where.go index 1efa05d32..7592ceb4c 100644 --- a/internal/ent/generated/loadbalancer/where.go +++ b/internal/ent/generated/loadbalancer/where.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -445,52 +455,6 @@ func ProviderIDContainsFold(v gidx.PrefixedID) predicate.LoadBalancer { return predicate.LoadBalancer(sql.FieldContainsFold(FieldProviderID, vc)) } -// HasAnnotations applies the HasEdge predicate on the "annotations" edge. -func HasAnnotations() predicate.LoadBalancer { - return predicate.LoadBalancer(func(s *sql.Selector) { - step := sqlgraph.NewStep( - sqlgraph.From(Table, FieldID), - sqlgraph.Edge(sqlgraph.O2M, true, AnnotationsTable, AnnotationsColumn), - ) - sqlgraph.HasNeighbors(s, step) - }) -} - -// HasAnnotationsWith applies the HasEdge predicate on the "annotations" edge with a given conditions (other predicates). -func HasAnnotationsWith(preds ...predicate.LoadBalancerAnnotation) predicate.LoadBalancer { - return predicate.LoadBalancer(func(s *sql.Selector) { - step := newAnnotationsStep() - sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { - for _, p := range preds { - p(s) - } - }) - }) -} - -// HasStatuses applies the HasEdge predicate on the "statuses" edge. -func HasStatuses() predicate.LoadBalancer { - return predicate.LoadBalancer(func(s *sql.Selector) { - step := sqlgraph.NewStep( - sqlgraph.From(Table, FieldID), - sqlgraph.Edge(sqlgraph.O2M, true, StatusesTable, StatusesColumn), - ) - sqlgraph.HasNeighbors(s, step) - }) -} - -// HasStatusesWith applies the HasEdge predicate on the "statuses" edge with a given conditions (other predicates). -func HasStatusesWith(preds ...predicate.LoadBalancerStatus) predicate.LoadBalancer { - return predicate.LoadBalancer(func(s *sql.Selector) { - step := newStatusesStep() - sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { - for _, p := range preds { - p(s) - } - }) - }) -} - // HasPorts applies the HasEdge predicate on the "ports" edge. func HasPorts() predicate.LoadBalancer { return predicate.LoadBalancer(func(s *sql.Selector) { diff --git a/internal/ent/generated/loadbalancer_create.go b/internal/ent/generated/loadbalancer_create.go index 65d7d5896..98ae4698a 100644 --- a/internal/ent/generated/loadbalancer_create.go +++ b/internal/ent/generated/loadbalancer_create.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -15,8 +25,6 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "go.infratographer.com/load-balancer-api/internal/ent/generated/port" "go.infratographer.com/load-balancer-api/internal/ent/generated/provider" "go.infratographer.com/x/gidx" @@ -95,36 +103,6 @@ func (lbc *LoadBalancerCreate) SetNillableID(gi *gidx.PrefixedID) *LoadBalancerC return lbc } -// AddAnnotationIDs adds the "annotations" edge to the LoadBalancerAnnotation entity by IDs. -func (lbc *LoadBalancerCreate) AddAnnotationIDs(ids ...gidx.PrefixedID) *LoadBalancerCreate { - lbc.mutation.AddAnnotationIDs(ids...) - return lbc -} - -// AddAnnotations adds the "annotations" edges to the LoadBalancerAnnotation entity. -func (lbc *LoadBalancerCreate) AddAnnotations(l ...*LoadBalancerAnnotation) *LoadBalancerCreate { - ids := make([]gidx.PrefixedID, len(l)) - for i := range l { - ids[i] = l[i].ID - } - return lbc.AddAnnotationIDs(ids...) -} - -// AddStatusIDs adds the "statuses" edge to the LoadBalancerStatus entity by IDs. -func (lbc *LoadBalancerCreate) AddStatusIDs(ids ...gidx.PrefixedID) *LoadBalancerCreate { - lbc.mutation.AddStatusIDs(ids...) - return lbc -} - -// AddStatuses adds the "statuses" edges to the LoadBalancerStatus entity. -func (lbc *LoadBalancerCreate) AddStatuses(l ...*LoadBalancerStatus) *LoadBalancerCreate { - ids := make([]gidx.PrefixedID, len(l)) - for i := range l { - ids[i] = l[i].ID - } - return lbc.AddStatusIDs(ids...) -} - // AddPortIDs adds the "ports" edge to the Port entity by IDs. func (lbc *LoadBalancerCreate) AddPortIDs(ids ...gidx.PrefixedID) *LoadBalancerCreate { lbc.mutation.AddPortIDs(ids...) @@ -287,38 +265,6 @@ func (lbc *LoadBalancerCreate) createSpec() (*LoadBalancer, *sqlgraph.CreateSpec _spec.SetField(loadbalancer.FieldLocationID, field.TypeString, value) _node.LocationID = value } - if nodes := lbc.mutation.AnnotationsIDs(); len(nodes) > 0 { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.AnnotationsTable, - Columns: []string{loadbalancer.AnnotationsColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _spec.Edges = append(_spec.Edges, edge) - } - if nodes := lbc.mutation.StatusesIDs(); len(nodes) > 0 { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.StatusesTable, - Columns: []string{loadbalancer.StatusesColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _spec.Edges = append(_spec.Edges, edge) - } if nodes := lbc.mutation.PortsIDs(); len(nodes) > 0 { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, diff --git a/internal/ent/generated/loadbalancer_delete.go b/internal/ent/generated/loadbalancer_delete.go index ec3018f87..fc5989919 100644 --- a/internal/ent/generated/loadbalancer_delete.go +++ b/internal/ent/generated/loadbalancer_delete.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/loadbalancer_query.go b/internal/ent/generated/loadbalancer_query.go index 20e235e67..be80195ad 100644 --- a/internal/ent/generated/loadbalancer_query.go +++ b/internal/ent/generated/loadbalancer_query.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -16,8 +26,6 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "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/provider" @@ -27,19 +35,15 @@ import ( // LoadBalancerQuery is the builder for querying LoadBalancer entities. type LoadBalancerQuery struct { config - ctx *QueryContext - order []loadbalancer.OrderOption - inters []Interceptor - predicates []predicate.LoadBalancer - withAnnotations *LoadBalancerAnnotationQuery - withStatuses *LoadBalancerStatusQuery - withPorts *PortQuery - withProvider *ProviderQuery - modifiers []func(*sql.Selector) - loadTotal []func(context.Context, []*LoadBalancer) error - withNamedAnnotations map[string]*LoadBalancerAnnotationQuery - withNamedStatuses map[string]*LoadBalancerStatusQuery - withNamedPorts map[string]*PortQuery + ctx *QueryContext + order []loadbalancer.OrderOption + inters []Interceptor + predicates []predicate.LoadBalancer + withPorts *PortQuery + withProvider *ProviderQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*LoadBalancer) error + withNamedPorts map[string]*PortQuery // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) @@ -76,50 +80,6 @@ func (lbq *LoadBalancerQuery) Order(o ...loadbalancer.OrderOption) *LoadBalancer return lbq } -// QueryAnnotations chains the current query on the "annotations" edge. -func (lbq *LoadBalancerQuery) QueryAnnotations() *LoadBalancerAnnotationQuery { - query := (&LoadBalancerAnnotationClient{config: lbq.config}).Query() - query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { - if err := lbq.prepareQuery(ctx); err != nil { - return nil, err - } - selector := lbq.sqlQuery(ctx) - if err := selector.Err(); err != nil { - return nil, err - } - step := sqlgraph.NewStep( - sqlgraph.From(loadbalancer.Table, loadbalancer.FieldID, selector), - sqlgraph.To(loadbalancerannotation.Table, loadbalancerannotation.FieldID), - sqlgraph.Edge(sqlgraph.O2M, true, loadbalancer.AnnotationsTable, loadbalancer.AnnotationsColumn), - ) - fromU = sqlgraph.SetNeighbors(lbq.driver.Dialect(), step) - return fromU, nil - } - return query -} - -// QueryStatuses chains the current query on the "statuses" edge. -func (lbq *LoadBalancerQuery) QueryStatuses() *LoadBalancerStatusQuery { - query := (&LoadBalancerStatusClient{config: lbq.config}).Query() - query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { - if err := lbq.prepareQuery(ctx); err != nil { - return nil, err - } - selector := lbq.sqlQuery(ctx) - if err := selector.Err(); err != nil { - return nil, err - } - step := sqlgraph.NewStep( - sqlgraph.From(loadbalancer.Table, loadbalancer.FieldID, selector), - sqlgraph.To(loadbalancerstatus.Table, loadbalancerstatus.FieldID), - sqlgraph.Edge(sqlgraph.O2M, true, loadbalancer.StatusesTable, loadbalancer.StatusesColumn), - ) - fromU = sqlgraph.SetNeighbors(lbq.driver.Dialect(), step) - return fromU, nil - } - return query -} - // QueryPorts chains the current query on the "ports" edge. func (lbq *LoadBalancerQuery) QueryPorts() *PortQuery { query := (&PortClient{config: lbq.config}).Query() @@ -351,43 +311,19 @@ func (lbq *LoadBalancerQuery) Clone() *LoadBalancerQuery { return nil } return &LoadBalancerQuery{ - config: lbq.config, - ctx: lbq.ctx.Clone(), - order: append([]loadbalancer.OrderOption{}, lbq.order...), - inters: append([]Interceptor{}, lbq.inters...), - predicates: append([]predicate.LoadBalancer{}, lbq.predicates...), - withAnnotations: lbq.withAnnotations.Clone(), - withStatuses: lbq.withStatuses.Clone(), - withPorts: lbq.withPorts.Clone(), - withProvider: lbq.withProvider.Clone(), + config: lbq.config, + ctx: lbq.ctx.Clone(), + order: append([]loadbalancer.OrderOption{}, lbq.order...), + inters: append([]Interceptor{}, lbq.inters...), + predicates: append([]predicate.LoadBalancer{}, lbq.predicates...), + withPorts: lbq.withPorts.Clone(), + withProvider: lbq.withProvider.Clone(), // clone intermediate query. sql: lbq.sql.Clone(), path: lbq.path, } } -// WithAnnotations tells the query-builder to eager-load the nodes that are connected to -// the "annotations" edge. The optional arguments are used to configure the query builder of the edge. -func (lbq *LoadBalancerQuery) WithAnnotations(opts ...func(*LoadBalancerAnnotationQuery)) *LoadBalancerQuery { - query := (&LoadBalancerAnnotationClient{config: lbq.config}).Query() - for _, opt := range opts { - opt(query) - } - lbq.withAnnotations = query - return lbq -} - -// WithStatuses tells the query-builder to eager-load the nodes that are connected to -// the "statuses" edge. The optional arguments are used to configure the query builder of the edge. -func (lbq *LoadBalancerQuery) WithStatuses(opts ...func(*LoadBalancerStatusQuery)) *LoadBalancerQuery { - query := (&LoadBalancerStatusClient{config: lbq.config}).Query() - for _, opt := range opts { - opt(query) - } - lbq.withStatuses = query - return lbq -} - // WithPorts tells the query-builder to eager-load the nodes that are connected to // the "ports" edge. The optional arguments are used to configure the query builder of the edge. func (lbq *LoadBalancerQuery) WithPorts(opts ...func(*PortQuery)) *LoadBalancerQuery { @@ -488,9 +424,7 @@ func (lbq *LoadBalancerQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([ var ( nodes = []*LoadBalancer{} _spec = lbq.querySpec() - loadedTypes = [4]bool{ - lbq.withAnnotations != nil, - lbq.withStatuses != nil, + loadedTypes = [2]bool{ lbq.withPorts != nil, lbq.withProvider != nil, } @@ -516,20 +450,6 @@ func (lbq *LoadBalancerQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([ if len(nodes) == 0 { return nodes, nil } - if query := lbq.withAnnotations; query != nil { - if err := lbq.loadAnnotations(ctx, query, nodes, - func(n *LoadBalancer) { n.Edges.Annotations = []*LoadBalancerAnnotation{} }, - func(n *LoadBalancer, e *LoadBalancerAnnotation) { n.Edges.Annotations = append(n.Edges.Annotations, e) }); err != nil { - return nil, err - } - } - if query := lbq.withStatuses; query != nil { - if err := lbq.loadStatuses(ctx, query, nodes, - func(n *LoadBalancer) { n.Edges.Statuses = []*LoadBalancerStatus{} }, - func(n *LoadBalancer, e *LoadBalancerStatus) { n.Edges.Statuses = append(n.Edges.Statuses, e) }); err != nil { - return nil, err - } - } if query := lbq.withPorts; query != nil { if err := lbq.loadPorts(ctx, query, nodes, func(n *LoadBalancer) { n.Edges.Ports = []*Port{} }, @@ -543,20 +463,6 @@ func (lbq *LoadBalancerQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([ return nil, err } } - for name, query := range lbq.withNamedAnnotations { - if err := lbq.loadAnnotations(ctx, query, nodes, - func(n *LoadBalancer) { n.appendNamedAnnotations(name) }, - func(n *LoadBalancer, e *LoadBalancerAnnotation) { n.appendNamedAnnotations(name, e) }); err != nil { - return nil, err - } - } - for name, query := range lbq.withNamedStatuses { - if err := lbq.loadStatuses(ctx, query, nodes, - func(n *LoadBalancer) { n.appendNamedStatuses(name) }, - func(n *LoadBalancer, e *LoadBalancerStatus) { n.appendNamedStatuses(name, e) }); err != nil { - return nil, err - } - } for name, query := range lbq.withNamedPorts { if err := lbq.loadPorts(ctx, query, nodes, func(n *LoadBalancer) { n.appendNamedPorts(name) }, @@ -572,66 +478,6 @@ func (lbq *LoadBalancerQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([ return nodes, nil } -func (lbq *LoadBalancerQuery) loadAnnotations(ctx context.Context, query *LoadBalancerAnnotationQuery, nodes []*LoadBalancer, init func(*LoadBalancer), assign func(*LoadBalancer, *LoadBalancerAnnotation)) error { - fks := make([]driver.Value, 0, len(nodes)) - nodeids := make(map[gidx.PrefixedID]*LoadBalancer) - for i := range nodes { - fks = append(fks, nodes[i].ID) - nodeids[nodes[i].ID] = nodes[i] - if init != nil { - init(nodes[i]) - } - } - if len(query.ctx.Fields) > 0 { - query.ctx.AppendFieldOnce(loadbalancerannotation.FieldLoadBalancerID) - } - query.Where(predicate.LoadBalancerAnnotation(func(s *sql.Selector) { - s.Where(sql.InValues(s.C(loadbalancer.AnnotationsColumn), fks...)) - })) - neighbors, err := query.All(ctx) - if err != nil { - return err - } - for _, n := range neighbors { - fk := n.LoadBalancerID - node, ok := nodeids[fk] - if !ok { - return fmt.Errorf(`unexpected referenced foreign-key "load_balancer_id" returned %v for node %v`, fk, n.ID) - } - assign(node, n) - } - return nil -} -func (lbq *LoadBalancerQuery) loadStatuses(ctx context.Context, query *LoadBalancerStatusQuery, nodes []*LoadBalancer, init func(*LoadBalancer), assign func(*LoadBalancer, *LoadBalancerStatus)) error { - fks := make([]driver.Value, 0, len(nodes)) - nodeids := make(map[gidx.PrefixedID]*LoadBalancer) - for i := range nodes { - fks = append(fks, nodes[i].ID) - nodeids[nodes[i].ID] = nodes[i] - if init != nil { - init(nodes[i]) - } - } - if len(query.ctx.Fields) > 0 { - query.ctx.AppendFieldOnce(loadbalancerstatus.FieldLoadBalancerID) - } - query.Where(predicate.LoadBalancerStatus(func(s *sql.Selector) { - s.Where(sql.InValues(s.C(loadbalancer.StatusesColumn), fks...)) - })) - neighbors, err := query.All(ctx) - if err != nil { - return err - } - for _, n := range neighbors { - fk := n.LoadBalancerID - node, ok := nodeids[fk] - if !ok { - return fmt.Errorf(`unexpected referenced foreign-key "load_balancer_id" returned %v for node %v`, fk, n.ID) - } - assign(node, n) - } - return nil -} func (lbq *LoadBalancerQuery) loadPorts(ctx context.Context, query *PortQuery, nodes []*LoadBalancer, init func(*LoadBalancer), assign func(*LoadBalancer, *Port)) error { fks := make([]driver.Value, 0, len(nodes)) nodeids := make(map[gidx.PrefixedID]*LoadBalancer) @@ -779,34 +625,6 @@ func (lbq *LoadBalancerQuery) sqlQuery(ctx context.Context) *sql.Selector { return selector } -// WithNamedAnnotations tells the query-builder to eager-load the nodes that are connected to the "annotations" -// edge with the given name. The optional arguments are used to configure the query builder of the edge. -func (lbq *LoadBalancerQuery) WithNamedAnnotations(name string, opts ...func(*LoadBalancerAnnotationQuery)) *LoadBalancerQuery { - query := (&LoadBalancerAnnotationClient{config: lbq.config}).Query() - for _, opt := range opts { - opt(query) - } - if lbq.withNamedAnnotations == nil { - lbq.withNamedAnnotations = make(map[string]*LoadBalancerAnnotationQuery) - } - lbq.withNamedAnnotations[name] = query - return lbq -} - -// WithNamedStatuses tells the query-builder to eager-load the nodes that are connected to the "statuses" -// edge with the given name. The optional arguments are used to configure the query builder of the edge. -func (lbq *LoadBalancerQuery) WithNamedStatuses(name string, opts ...func(*LoadBalancerStatusQuery)) *LoadBalancerQuery { - query := (&LoadBalancerStatusClient{config: lbq.config}).Query() - for _, opt := range opts { - opt(query) - } - if lbq.withNamedStatuses == nil { - lbq.withNamedStatuses = make(map[string]*LoadBalancerStatusQuery) - } - lbq.withNamedStatuses[name] = query - return lbq -} - // WithNamedPorts tells the query-builder to eager-load the nodes that are connected to the "ports" // edge with the given name. The optional arguments are used to configure the query builder of the edge. func (lbq *LoadBalancerQuery) WithNamedPorts(name string, opts ...func(*PortQuery)) *LoadBalancerQuery { diff --git a/internal/ent/generated/loadbalancer_update.go b/internal/ent/generated/loadbalancer_update.go index 94bb4b21f..ac741b4ce 100644 --- a/internal/ent/generated/loadbalancer_update.go +++ b/internal/ent/generated/loadbalancer_update.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -15,8 +25,6 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "go.infratographer.com/load-balancer-api/internal/ent/generated/port" "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" "go.infratographer.com/x/gidx" @@ -41,36 +49,6 @@ func (lbu *LoadBalancerUpdate) SetName(s string) *LoadBalancerUpdate { return lbu } -// AddAnnotationIDs adds the "annotations" edge to the LoadBalancerAnnotation entity by IDs. -func (lbu *LoadBalancerUpdate) AddAnnotationIDs(ids ...gidx.PrefixedID) *LoadBalancerUpdate { - lbu.mutation.AddAnnotationIDs(ids...) - return lbu -} - -// AddAnnotations adds the "annotations" edges to the LoadBalancerAnnotation entity. -func (lbu *LoadBalancerUpdate) AddAnnotations(l ...*LoadBalancerAnnotation) *LoadBalancerUpdate { - ids := make([]gidx.PrefixedID, len(l)) - for i := range l { - ids[i] = l[i].ID - } - return lbu.AddAnnotationIDs(ids...) -} - -// AddStatusIDs adds the "statuses" edge to the LoadBalancerStatus entity by IDs. -func (lbu *LoadBalancerUpdate) AddStatusIDs(ids ...gidx.PrefixedID) *LoadBalancerUpdate { - lbu.mutation.AddStatusIDs(ids...) - return lbu -} - -// AddStatuses adds the "statuses" edges to the LoadBalancerStatus entity. -func (lbu *LoadBalancerUpdate) AddStatuses(l ...*LoadBalancerStatus) *LoadBalancerUpdate { - ids := make([]gidx.PrefixedID, len(l)) - for i := range l { - ids[i] = l[i].ID - } - return lbu.AddStatusIDs(ids...) -} - // AddPortIDs adds the "ports" edge to the Port entity by IDs. func (lbu *LoadBalancerUpdate) AddPortIDs(ids ...gidx.PrefixedID) *LoadBalancerUpdate { lbu.mutation.AddPortIDs(ids...) @@ -91,48 +69,6 @@ func (lbu *LoadBalancerUpdate) Mutation() *LoadBalancerMutation { return lbu.mutation } -// ClearAnnotations clears all "annotations" edges to the LoadBalancerAnnotation entity. -func (lbu *LoadBalancerUpdate) ClearAnnotations() *LoadBalancerUpdate { - lbu.mutation.ClearAnnotations() - return lbu -} - -// RemoveAnnotationIDs removes the "annotations" edge to LoadBalancerAnnotation entities by IDs. -func (lbu *LoadBalancerUpdate) RemoveAnnotationIDs(ids ...gidx.PrefixedID) *LoadBalancerUpdate { - lbu.mutation.RemoveAnnotationIDs(ids...) - return lbu -} - -// RemoveAnnotations removes "annotations" edges to LoadBalancerAnnotation entities. -func (lbu *LoadBalancerUpdate) RemoveAnnotations(l ...*LoadBalancerAnnotation) *LoadBalancerUpdate { - ids := make([]gidx.PrefixedID, len(l)) - for i := range l { - ids[i] = l[i].ID - } - return lbu.RemoveAnnotationIDs(ids...) -} - -// ClearStatuses clears all "statuses" edges to the LoadBalancerStatus entity. -func (lbu *LoadBalancerUpdate) ClearStatuses() *LoadBalancerUpdate { - lbu.mutation.ClearStatuses() - return lbu -} - -// RemoveStatusIDs removes the "statuses" edge to LoadBalancerStatus entities by IDs. -func (lbu *LoadBalancerUpdate) RemoveStatusIDs(ids ...gidx.PrefixedID) *LoadBalancerUpdate { - lbu.mutation.RemoveStatusIDs(ids...) - return lbu -} - -// RemoveStatuses removes "statuses" edges to LoadBalancerStatus entities. -func (lbu *LoadBalancerUpdate) RemoveStatuses(l ...*LoadBalancerStatus) *LoadBalancerUpdate { - ids := make([]gidx.PrefixedID, len(l)) - for i := range l { - ids[i] = l[i].ID - } - return lbu.RemoveStatusIDs(ids...) -} - // ClearPorts clears all "ports" edges to the Port entity. func (lbu *LoadBalancerUpdate) ClearPorts() *LoadBalancerUpdate { lbu.mutation.ClearPorts() @@ -221,96 +157,6 @@ func (lbu *LoadBalancerUpdate) sqlSave(ctx context.Context) (n int, err error) { if value, ok := lbu.mutation.Name(); ok { _spec.SetField(loadbalancer.FieldName, field.TypeString, value) } - if lbu.mutation.AnnotationsCleared() { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.AnnotationsTable, - Columns: []string{loadbalancer.AnnotationsColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString), - }, - } - _spec.Edges.Clear = append(_spec.Edges.Clear, edge) - } - if nodes := lbu.mutation.RemovedAnnotationsIDs(); len(nodes) > 0 && !lbu.mutation.AnnotationsCleared() { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.AnnotationsTable, - Columns: []string{loadbalancer.AnnotationsColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _spec.Edges.Clear = append(_spec.Edges.Clear, edge) - } - if nodes := lbu.mutation.AnnotationsIDs(); len(nodes) > 0 { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.AnnotationsTable, - Columns: []string{loadbalancer.AnnotationsColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _spec.Edges.Add = append(_spec.Edges.Add, edge) - } - if lbu.mutation.StatusesCleared() { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.StatusesTable, - Columns: []string{loadbalancer.StatusesColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString), - }, - } - _spec.Edges.Clear = append(_spec.Edges.Clear, edge) - } - if nodes := lbu.mutation.RemovedStatusesIDs(); len(nodes) > 0 && !lbu.mutation.StatusesCleared() { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.StatusesTable, - Columns: []string{loadbalancer.StatusesColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _spec.Edges.Clear = append(_spec.Edges.Clear, edge) - } - if nodes := lbu.mutation.StatusesIDs(); len(nodes) > 0 { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.StatusesTable, - Columns: []string{loadbalancer.StatusesColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _spec.Edges.Add = append(_spec.Edges.Add, edge) - } if lbu.mutation.PortsCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, @@ -382,36 +228,6 @@ func (lbuo *LoadBalancerUpdateOne) SetName(s string) *LoadBalancerUpdateOne { return lbuo } -// AddAnnotationIDs adds the "annotations" edge to the LoadBalancerAnnotation entity by IDs. -func (lbuo *LoadBalancerUpdateOne) AddAnnotationIDs(ids ...gidx.PrefixedID) *LoadBalancerUpdateOne { - lbuo.mutation.AddAnnotationIDs(ids...) - return lbuo -} - -// AddAnnotations adds the "annotations" edges to the LoadBalancerAnnotation entity. -func (lbuo *LoadBalancerUpdateOne) AddAnnotations(l ...*LoadBalancerAnnotation) *LoadBalancerUpdateOne { - ids := make([]gidx.PrefixedID, len(l)) - for i := range l { - ids[i] = l[i].ID - } - return lbuo.AddAnnotationIDs(ids...) -} - -// AddStatusIDs adds the "statuses" edge to the LoadBalancerStatus entity by IDs. -func (lbuo *LoadBalancerUpdateOne) AddStatusIDs(ids ...gidx.PrefixedID) *LoadBalancerUpdateOne { - lbuo.mutation.AddStatusIDs(ids...) - return lbuo -} - -// AddStatuses adds the "statuses" edges to the LoadBalancerStatus entity. -func (lbuo *LoadBalancerUpdateOne) AddStatuses(l ...*LoadBalancerStatus) *LoadBalancerUpdateOne { - ids := make([]gidx.PrefixedID, len(l)) - for i := range l { - ids[i] = l[i].ID - } - return lbuo.AddStatusIDs(ids...) -} - // AddPortIDs adds the "ports" edge to the Port entity by IDs. func (lbuo *LoadBalancerUpdateOne) AddPortIDs(ids ...gidx.PrefixedID) *LoadBalancerUpdateOne { lbuo.mutation.AddPortIDs(ids...) @@ -432,48 +248,6 @@ func (lbuo *LoadBalancerUpdateOne) Mutation() *LoadBalancerMutation { return lbuo.mutation } -// ClearAnnotations clears all "annotations" edges to the LoadBalancerAnnotation entity. -func (lbuo *LoadBalancerUpdateOne) ClearAnnotations() *LoadBalancerUpdateOne { - lbuo.mutation.ClearAnnotations() - return lbuo -} - -// RemoveAnnotationIDs removes the "annotations" edge to LoadBalancerAnnotation entities by IDs. -func (lbuo *LoadBalancerUpdateOne) RemoveAnnotationIDs(ids ...gidx.PrefixedID) *LoadBalancerUpdateOne { - lbuo.mutation.RemoveAnnotationIDs(ids...) - return lbuo -} - -// RemoveAnnotations removes "annotations" edges to LoadBalancerAnnotation entities. -func (lbuo *LoadBalancerUpdateOne) RemoveAnnotations(l ...*LoadBalancerAnnotation) *LoadBalancerUpdateOne { - ids := make([]gidx.PrefixedID, len(l)) - for i := range l { - ids[i] = l[i].ID - } - return lbuo.RemoveAnnotationIDs(ids...) -} - -// ClearStatuses clears all "statuses" edges to the LoadBalancerStatus entity. -func (lbuo *LoadBalancerUpdateOne) ClearStatuses() *LoadBalancerUpdateOne { - lbuo.mutation.ClearStatuses() - return lbuo -} - -// RemoveStatusIDs removes the "statuses" edge to LoadBalancerStatus entities by IDs. -func (lbuo *LoadBalancerUpdateOne) RemoveStatusIDs(ids ...gidx.PrefixedID) *LoadBalancerUpdateOne { - lbuo.mutation.RemoveStatusIDs(ids...) - return lbuo -} - -// RemoveStatuses removes "statuses" edges to LoadBalancerStatus entities. -func (lbuo *LoadBalancerUpdateOne) RemoveStatuses(l ...*LoadBalancerStatus) *LoadBalancerUpdateOne { - ids := make([]gidx.PrefixedID, len(l)) - for i := range l { - ids[i] = l[i].ID - } - return lbuo.RemoveStatusIDs(ids...) -} - // ClearPorts clears all "ports" edges to the Port entity. func (lbuo *LoadBalancerUpdateOne) ClearPorts() *LoadBalancerUpdateOne { lbuo.mutation.ClearPorts() @@ -592,96 +366,6 @@ func (lbuo *LoadBalancerUpdateOne) sqlSave(ctx context.Context) (_node *LoadBala if value, ok := lbuo.mutation.Name(); ok { _spec.SetField(loadbalancer.FieldName, field.TypeString, value) } - if lbuo.mutation.AnnotationsCleared() { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.AnnotationsTable, - Columns: []string{loadbalancer.AnnotationsColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString), - }, - } - _spec.Edges.Clear = append(_spec.Edges.Clear, edge) - } - if nodes := lbuo.mutation.RemovedAnnotationsIDs(); len(nodes) > 0 && !lbuo.mutation.AnnotationsCleared() { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.AnnotationsTable, - Columns: []string{loadbalancer.AnnotationsColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _spec.Edges.Clear = append(_spec.Edges.Clear, edge) - } - if nodes := lbuo.mutation.AnnotationsIDs(); len(nodes) > 0 { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.AnnotationsTable, - Columns: []string{loadbalancer.AnnotationsColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _spec.Edges.Add = append(_spec.Edges.Add, edge) - } - if lbuo.mutation.StatusesCleared() { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.StatusesTable, - Columns: []string{loadbalancer.StatusesColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString), - }, - } - _spec.Edges.Clear = append(_spec.Edges.Clear, edge) - } - if nodes := lbuo.mutation.RemovedStatusesIDs(); len(nodes) > 0 && !lbuo.mutation.StatusesCleared() { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.StatusesTable, - Columns: []string{loadbalancer.StatusesColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _spec.Edges.Clear = append(_spec.Edges.Clear, edge) - } - if nodes := lbuo.mutation.StatusesIDs(); len(nodes) > 0 { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.O2M, - Inverse: true, - Table: loadbalancer.StatusesTable, - Columns: []string{loadbalancer.StatusesColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _spec.Edges.Add = append(_spec.Edges.Add, edge) - } if lbuo.mutation.PortsCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, diff --git a/internal/ent/generated/loadbalancerannotation.go b/internal/ent/generated/loadbalancerannotation.go deleted file mode 100644 index 0adffeed1..000000000 --- a/internal/ent/generated/loadbalancerannotation.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package generated - -import ( - "fmt" - "strings" - "time" - - "entgo.io/ent" - "entgo.io/ent/dialect/sql" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/x/gidx" -) - -// LoadBalancerAnnotation is the model entity for the LoadBalancerAnnotation schema. -type LoadBalancerAnnotation struct { - config `json:"-"` - // ID of the ent. - ID gidx.PrefixedID `json:"id,omitempty"` - // CreatedAt holds the value of the "created_at" field. - CreatedAt time.Time `json:"created_at,omitempty"` - // UpdatedAt holds the value of the "updated_at" field. - UpdatedAt time.Time `json:"updated_at,omitempty"` - // LoadBalancerID holds the value of the "load_balancer_id" field. - LoadBalancerID gidx.PrefixedID `json:"load_balancer_id,omitempty"` - // Edges holds the relations/edges for other nodes in the graph. - // The values are being populated by the LoadBalancerAnnotationQuery when eager-loading is set. - Edges LoadBalancerAnnotationEdges `json:"edges"` - selectValues sql.SelectValues -} - -// LoadBalancerAnnotationEdges holds the relations/edges for other nodes in the graph. -type LoadBalancerAnnotationEdges struct { - // LoadBalancer holds the value of the load_balancer edge. - LoadBalancer *LoadBalancer `json:"load_balancer,omitempty"` - // loadedTypes holds the information for reporting if a - // type was loaded (or requested) in eager-loading or not. - loadedTypes [1]bool - // totalCount holds the count of the edges above. - totalCount [1]map[string]int -} - -// LoadBalancerOrErr returns the LoadBalancer value or an error if the edge -// was not loaded in eager-loading, or loaded but was not found. -func (e LoadBalancerAnnotationEdges) LoadBalancerOrErr() (*LoadBalancer, error) { - if e.loadedTypes[0] { - if e.LoadBalancer == nil { - // Edge was loaded but was not found. - return nil, &NotFoundError{label: loadbalancer.Label} - } - return e.LoadBalancer, nil - } - return nil, &NotLoadedError{edge: "load_balancer"} -} - -// scanValues returns the types for scanning values from sql.Rows. -func (*LoadBalancerAnnotation) scanValues(columns []string) ([]any, error) { - values := make([]any, len(columns)) - for i := range columns { - switch columns[i] { - case loadbalancerannotation.FieldID, loadbalancerannotation.FieldLoadBalancerID: - values[i] = new(gidx.PrefixedID) - case loadbalancerannotation.FieldCreatedAt, loadbalancerannotation.FieldUpdatedAt: - values[i] = new(sql.NullTime) - default: - values[i] = new(sql.UnknownType) - } - } - return values, nil -} - -// assignValues assigns the values that were returned from sql.Rows (after scanning) -// to the LoadBalancerAnnotation fields. -func (lba *LoadBalancerAnnotation) assignValues(columns []string, values []any) error { - if m, n := len(values), len(columns); m < n { - return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) - } - for i := range columns { - switch columns[i] { - case loadbalancerannotation.FieldID: - if value, ok := values[i].(*gidx.PrefixedID); !ok { - return fmt.Errorf("unexpected type %T for field id", values[i]) - } else if value != nil { - lba.ID = *value - } - case loadbalancerannotation.FieldCreatedAt: - if value, ok := values[i].(*sql.NullTime); !ok { - return fmt.Errorf("unexpected type %T for field created_at", values[i]) - } else if value.Valid { - lba.CreatedAt = value.Time - } - case loadbalancerannotation.FieldUpdatedAt: - if value, ok := values[i].(*sql.NullTime); !ok { - return fmt.Errorf("unexpected type %T for field updated_at", values[i]) - } else if value.Valid { - lba.UpdatedAt = value.Time - } - case loadbalancerannotation.FieldLoadBalancerID: - if value, ok := values[i].(*gidx.PrefixedID); !ok { - return fmt.Errorf("unexpected type %T for field load_balancer_id", values[i]) - } else if value != nil { - lba.LoadBalancerID = *value - } - default: - lba.selectValues.Set(columns[i], values[i]) - } - } - return nil -} - -// Value returns the ent.Value that was dynamically selected and assigned to the LoadBalancerAnnotation. -// This includes values selected through modifiers, order, etc. -func (lba *LoadBalancerAnnotation) Value(name string) (ent.Value, error) { - return lba.selectValues.Get(name) -} - -// QueryLoadBalancer queries the "load_balancer" edge of the LoadBalancerAnnotation entity. -func (lba *LoadBalancerAnnotation) QueryLoadBalancer() *LoadBalancerQuery { - return NewLoadBalancerAnnotationClient(lba.config).QueryLoadBalancer(lba) -} - -// Update returns a builder for updating this LoadBalancerAnnotation. -// Note that you need to call LoadBalancerAnnotation.Unwrap() before calling this method if this LoadBalancerAnnotation -// was returned from a transaction, and the transaction was committed or rolled back. -func (lba *LoadBalancerAnnotation) Update() *LoadBalancerAnnotationUpdateOne { - return NewLoadBalancerAnnotationClient(lba.config).UpdateOne(lba) -} - -// Unwrap unwraps the LoadBalancerAnnotation entity that was returned from a transaction after it was closed, -// so that all future queries will be executed through the driver which created the transaction. -func (lba *LoadBalancerAnnotation) Unwrap() *LoadBalancerAnnotation { - _tx, ok := lba.config.driver.(*txDriver) - if !ok { - panic("generated: LoadBalancerAnnotation is not a transactional entity") - } - lba.config.driver = _tx.drv - return lba -} - -// String implements the fmt.Stringer. -func (lba *LoadBalancerAnnotation) String() string { - var builder strings.Builder - builder.WriteString("LoadBalancerAnnotation(") - builder.WriteString(fmt.Sprintf("id=%v, ", lba.ID)) - builder.WriteString("created_at=") - builder.WriteString(lba.CreatedAt.Format(time.ANSIC)) - builder.WriteString(", ") - builder.WriteString("updated_at=") - builder.WriteString(lba.UpdatedAt.Format(time.ANSIC)) - builder.WriteString(", ") - builder.WriteString("load_balancer_id=") - builder.WriteString(fmt.Sprintf("%v", lba.LoadBalancerID)) - builder.WriteByte(')') - return builder.String() -} - -// IsEntity implement fedruntime.Entity -func (lba LoadBalancerAnnotation) IsEntity() {} - -// LoadBalancerAnnotations is a parsable slice of LoadBalancerAnnotation. -type LoadBalancerAnnotations []*LoadBalancerAnnotation diff --git a/internal/ent/generated/loadbalancerannotation/loadbalancerannotation.go b/internal/ent/generated/loadbalancerannotation/loadbalancerannotation.go deleted file mode 100644 index c424db1ee..000000000 --- a/internal/ent/generated/loadbalancerannotation/loadbalancerannotation.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package loadbalancerannotation - -import ( - "time" - - "entgo.io/ent/dialect/sql" - "entgo.io/ent/dialect/sql/sqlgraph" - "go.infratographer.com/x/gidx" -) - -const ( - // Label holds the string label denoting the loadbalancerannotation type in the database. - Label = "load_balancer_annotation" - // FieldID holds the string denoting the id field in the database. - FieldID = "id" - // FieldCreatedAt holds the string denoting the created_at field in the database. - FieldCreatedAt = "created_at" - // FieldUpdatedAt holds the string denoting the updated_at field in the database. - FieldUpdatedAt = "updated_at" - // FieldLoadBalancerID holds the string denoting the load_balancer_id field in the database. - FieldLoadBalancerID = "load_balancer_id" - // EdgeLoadBalancer holds the string denoting the load_balancer edge name in mutations. - EdgeLoadBalancer = "load_balancer" - // Table holds the table name of the loadbalancerannotation in the database. - Table = "load_balancer_annotations" - // LoadBalancerTable is the table that holds the load_balancer relation/edge. - LoadBalancerTable = "load_balancer_annotations" - // LoadBalancerInverseTable is the table name for the LoadBalancer entity. - // It exists in this package in order to avoid circular dependency with the "loadbalancer" package. - LoadBalancerInverseTable = "load_balancers" - // LoadBalancerColumn is the table column denoting the load_balancer relation/edge. - LoadBalancerColumn = "load_balancer_id" -) - -// Columns holds all SQL columns for loadbalancerannotation fields. -var Columns = []string{ - FieldID, - FieldCreatedAt, - FieldUpdatedAt, - FieldLoadBalancerID, -} - -// ValidColumn reports if the column name is valid (part of the table columns). -func ValidColumn(column string) bool { - for i := range Columns { - if column == Columns[i] { - return true - } - } - return false -} - -var ( - // 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. - DefaultUpdatedAt func() time.Time - // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. - UpdateDefaultUpdatedAt func() time.Time - // DefaultID holds the default value on creation for the "id" field. - DefaultID func() gidx.PrefixedID -) - -// OrderOption defines the ordering options for the LoadBalancerAnnotation queries. -type OrderOption func(*sql.Selector) - -// ByID orders the results by the id field. -func ByID(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldID, opts...).ToFunc() -} - -// ByCreatedAt orders the results by the created_at field. -func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() -} - -// ByUpdatedAt orders the results by the updated_at field. -func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() -} - -// ByLoadBalancerID orders the results by the load_balancer_id field. -func ByLoadBalancerID(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldLoadBalancerID, opts...).ToFunc() -} - -// ByLoadBalancerField orders the results by load_balancer field. -func ByLoadBalancerField(field string, opts ...sql.OrderTermOption) OrderOption { - return func(s *sql.Selector) { - sqlgraph.OrderByNeighborTerms(s, newLoadBalancerStep(), sql.OrderByField(field, opts...)) - } -} -func newLoadBalancerStep() *sqlgraph.Step { - return sqlgraph.NewStep( - sqlgraph.From(Table, FieldID), - sqlgraph.To(LoadBalancerInverseTable, FieldID), - sqlgraph.Edge(sqlgraph.M2O, false, LoadBalancerTable, LoadBalancerColumn), - ) -} diff --git a/internal/ent/generated/loadbalancerannotation/where.go b/internal/ent/generated/loadbalancerannotation/where.go deleted file mode 100644 index bcc0635a4..000000000 --- a/internal/ent/generated/loadbalancerannotation/where.go +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package loadbalancerannotation - -import ( - "time" - - "entgo.io/ent/dialect/sql" - "entgo.io/ent/dialect/sql/sqlgraph" - "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" - "go.infratographer.com/x/gidx" -) - -// ID filters vertices based on their ID field. -func ID(id gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldEQ(FieldID, id)) -} - -// IDEQ applies the EQ predicate on the ID field. -func IDEQ(id gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldEQ(FieldID, id)) -} - -// IDNEQ applies the NEQ predicate on the ID field. -func IDNEQ(id gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldNEQ(FieldID, id)) -} - -// IDIn applies the In predicate on the ID field. -func IDIn(ids ...gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldIn(FieldID, ids...)) -} - -// IDNotIn applies the NotIn predicate on the ID field. -func IDNotIn(ids ...gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldNotIn(FieldID, ids...)) -} - -// IDGT applies the GT predicate on the ID field. -func IDGT(id gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldGT(FieldID, id)) -} - -// IDGTE applies the GTE predicate on the ID field. -func IDGTE(id gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldGTE(FieldID, id)) -} - -// IDLT applies the LT predicate on the ID field. -func IDLT(id gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldLT(FieldID, id)) -} - -// IDLTE applies the LTE predicate on the ID field. -func IDLTE(id gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldLTE(FieldID, id)) -} - -// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. -func CreatedAt(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldEQ(FieldCreatedAt, v)) -} - -// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. -func UpdatedAt(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldEQ(FieldUpdatedAt, v)) -} - -// LoadBalancerID applies equality check predicate on the "load_balancer_id" field. It's identical to LoadBalancerIDEQ. -func LoadBalancerID(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldEQ(FieldLoadBalancerID, v)) -} - -// CreatedAtEQ applies the EQ predicate on the "created_at" field. -func CreatedAtEQ(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldEQ(FieldCreatedAt, v)) -} - -// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. -func CreatedAtNEQ(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldNEQ(FieldCreatedAt, v)) -} - -// CreatedAtIn applies the In predicate on the "created_at" field. -func CreatedAtIn(vs ...time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldIn(FieldCreatedAt, vs...)) -} - -// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. -func CreatedAtNotIn(vs ...time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldNotIn(FieldCreatedAt, vs...)) -} - -// CreatedAtGT applies the GT predicate on the "created_at" field. -func CreatedAtGT(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldGT(FieldCreatedAt, v)) -} - -// CreatedAtGTE applies the GTE predicate on the "created_at" field. -func CreatedAtGTE(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldGTE(FieldCreatedAt, v)) -} - -// CreatedAtLT applies the LT predicate on the "created_at" field. -func CreatedAtLT(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldLT(FieldCreatedAt, v)) -} - -// CreatedAtLTE applies the LTE predicate on the "created_at" field. -func CreatedAtLTE(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldLTE(FieldCreatedAt, v)) -} - -// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. -func UpdatedAtEQ(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldEQ(FieldUpdatedAt, v)) -} - -// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. -func UpdatedAtNEQ(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldNEQ(FieldUpdatedAt, v)) -} - -// UpdatedAtIn applies the In predicate on the "updated_at" field. -func UpdatedAtIn(vs ...time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldIn(FieldUpdatedAt, vs...)) -} - -// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. -func UpdatedAtNotIn(vs ...time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldNotIn(FieldUpdatedAt, vs...)) -} - -// UpdatedAtGT applies the GT predicate on the "updated_at" field. -func UpdatedAtGT(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldGT(FieldUpdatedAt, v)) -} - -// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. -func UpdatedAtGTE(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldGTE(FieldUpdatedAt, v)) -} - -// UpdatedAtLT applies the LT predicate on the "updated_at" field. -func UpdatedAtLT(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldLT(FieldUpdatedAt, v)) -} - -// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. -func UpdatedAtLTE(v time.Time) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldLTE(FieldUpdatedAt, v)) -} - -// LoadBalancerIDEQ applies the EQ predicate on the "load_balancer_id" field. -func LoadBalancerIDEQ(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldEQ(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDNEQ applies the NEQ predicate on the "load_balancer_id" field. -func LoadBalancerIDNEQ(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldNEQ(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDIn applies the In predicate on the "load_balancer_id" field. -func LoadBalancerIDIn(vs ...gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldIn(FieldLoadBalancerID, vs...)) -} - -// LoadBalancerIDNotIn applies the NotIn predicate on the "load_balancer_id" field. -func LoadBalancerIDNotIn(vs ...gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldNotIn(FieldLoadBalancerID, vs...)) -} - -// LoadBalancerIDGT applies the GT predicate on the "load_balancer_id" field. -func LoadBalancerIDGT(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldGT(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDGTE applies the GTE predicate on the "load_balancer_id" field. -func LoadBalancerIDGTE(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldGTE(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDLT applies the LT predicate on the "load_balancer_id" field. -func LoadBalancerIDLT(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldLT(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDLTE applies the LTE predicate on the "load_balancer_id" field. -func LoadBalancerIDLTE(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(sql.FieldLTE(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDContains applies the Contains predicate on the "load_balancer_id" field. -func LoadBalancerIDContains(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - vc := string(v) - return predicate.LoadBalancerAnnotation(sql.FieldContains(FieldLoadBalancerID, vc)) -} - -// LoadBalancerIDHasPrefix applies the HasPrefix predicate on the "load_balancer_id" field. -func LoadBalancerIDHasPrefix(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - vc := string(v) - return predicate.LoadBalancerAnnotation(sql.FieldHasPrefix(FieldLoadBalancerID, vc)) -} - -// LoadBalancerIDHasSuffix applies the HasSuffix predicate on the "load_balancer_id" field. -func LoadBalancerIDHasSuffix(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - vc := string(v) - return predicate.LoadBalancerAnnotation(sql.FieldHasSuffix(FieldLoadBalancerID, vc)) -} - -// LoadBalancerIDEqualFold applies the EqualFold predicate on the "load_balancer_id" field. -func LoadBalancerIDEqualFold(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - vc := string(v) - return predicate.LoadBalancerAnnotation(sql.FieldEqualFold(FieldLoadBalancerID, vc)) -} - -// LoadBalancerIDContainsFold applies the ContainsFold predicate on the "load_balancer_id" field. -func LoadBalancerIDContainsFold(v gidx.PrefixedID) predicate.LoadBalancerAnnotation { - vc := string(v) - return predicate.LoadBalancerAnnotation(sql.FieldContainsFold(FieldLoadBalancerID, vc)) -} - -// HasLoadBalancer applies the HasEdge predicate on the "load_balancer" edge. -func HasLoadBalancer() predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(func(s *sql.Selector) { - step := sqlgraph.NewStep( - sqlgraph.From(Table, FieldID), - sqlgraph.Edge(sqlgraph.M2O, false, LoadBalancerTable, LoadBalancerColumn), - ) - sqlgraph.HasNeighbors(s, step) - }) -} - -// HasLoadBalancerWith applies the HasEdge predicate on the "load_balancer" edge with a given conditions (other predicates). -func HasLoadBalancerWith(preds ...predicate.LoadBalancer) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(func(s *sql.Selector) { - step := newLoadBalancerStep() - sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { - for _, p := range preds { - p(s) - } - }) - }) -} - -// And groups predicates with the AND operator between them. -func And(predicates ...predicate.LoadBalancerAnnotation) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }) -} - -// Or groups predicates with the OR operator between them. -func Or(predicates ...predicate.LoadBalancerAnnotation) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) - } - s.Where(s1.P()) - }) -} - -// Not applies the not operator on the given predicate. -func Not(p predicate.LoadBalancerAnnotation) predicate.LoadBalancerAnnotation { - return predicate.LoadBalancerAnnotation(func(s *sql.Selector) { - p(s.Not()) - }) -} diff --git a/internal/ent/generated/loadbalancerannotation_create.go b/internal/ent/generated/loadbalancerannotation_create.go deleted file mode 100644 index 79e2f591c..000000000 --- a/internal/ent/generated/loadbalancerannotation_create.go +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package generated - -import ( - "context" - "errors" - "fmt" - "time" - - "entgo.io/ent/dialect/sql/sqlgraph" - "entgo.io/ent/schema/field" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/x/gidx" -) - -// LoadBalancerAnnotationCreate is the builder for creating a LoadBalancerAnnotation entity. -type LoadBalancerAnnotationCreate struct { - config - mutation *LoadBalancerAnnotationMutation - hooks []Hook -} - -// SetCreatedAt sets the "created_at" field. -func (lbac *LoadBalancerAnnotationCreate) SetCreatedAt(t time.Time) *LoadBalancerAnnotationCreate { - lbac.mutation.SetCreatedAt(t) - return lbac -} - -// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. -func (lbac *LoadBalancerAnnotationCreate) SetNillableCreatedAt(t *time.Time) *LoadBalancerAnnotationCreate { - if t != nil { - lbac.SetCreatedAt(*t) - } - return lbac -} - -// SetUpdatedAt sets the "updated_at" field. -func (lbac *LoadBalancerAnnotationCreate) SetUpdatedAt(t time.Time) *LoadBalancerAnnotationCreate { - lbac.mutation.SetUpdatedAt(t) - return lbac -} - -// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. -func (lbac *LoadBalancerAnnotationCreate) SetNillableUpdatedAt(t *time.Time) *LoadBalancerAnnotationCreate { - if t != nil { - lbac.SetUpdatedAt(*t) - } - return lbac -} - -// SetLoadBalancerID sets the "load_balancer_id" field. -func (lbac *LoadBalancerAnnotationCreate) SetLoadBalancerID(gi gidx.PrefixedID) *LoadBalancerAnnotationCreate { - lbac.mutation.SetLoadBalancerID(gi) - return lbac -} - -// SetID sets the "id" field. -func (lbac *LoadBalancerAnnotationCreate) SetID(gi gidx.PrefixedID) *LoadBalancerAnnotationCreate { - lbac.mutation.SetID(gi) - return lbac -} - -// SetNillableID sets the "id" field if the given value is not nil. -func (lbac *LoadBalancerAnnotationCreate) SetNillableID(gi *gidx.PrefixedID) *LoadBalancerAnnotationCreate { - if gi != nil { - lbac.SetID(*gi) - } - return lbac -} - -// SetLoadBalancer sets the "load_balancer" edge to the LoadBalancer entity. -func (lbac *LoadBalancerAnnotationCreate) SetLoadBalancer(l *LoadBalancer) *LoadBalancerAnnotationCreate { - return lbac.SetLoadBalancerID(l.ID) -} - -// Mutation returns the LoadBalancerAnnotationMutation object of the builder. -func (lbac *LoadBalancerAnnotationCreate) Mutation() *LoadBalancerAnnotationMutation { - return lbac.mutation -} - -// Save creates the LoadBalancerAnnotation in the database. -func (lbac *LoadBalancerAnnotationCreate) Save(ctx context.Context) (*LoadBalancerAnnotation, error) { - lbac.defaults() - return withHooks(ctx, lbac.sqlSave, lbac.mutation, lbac.hooks) -} - -// SaveX calls Save and panics if Save returns an error. -func (lbac *LoadBalancerAnnotationCreate) SaveX(ctx context.Context) *LoadBalancerAnnotation { - v, err := lbac.Save(ctx) - if err != nil { - panic(err) - } - return v -} - -// Exec executes the query. -func (lbac *LoadBalancerAnnotationCreate) Exec(ctx context.Context) error { - _, err := lbac.Save(ctx) - return err -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbac *LoadBalancerAnnotationCreate) ExecX(ctx context.Context) { - if err := lbac.Exec(ctx); err != nil { - panic(err) - } -} - -// defaults sets the default values of the builder before save. -func (lbac *LoadBalancerAnnotationCreate) defaults() { - if _, ok := lbac.mutation.CreatedAt(); !ok { - v := loadbalancerannotation.DefaultCreatedAt() - lbac.mutation.SetCreatedAt(v) - } - if _, ok := lbac.mutation.UpdatedAt(); !ok { - v := loadbalancerannotation.DefaultUpdatedAt() - lbac.mutation.SetUpdatedAt(v) - } - if _, ok := lbac.mutation.ID(); !ok { - v := loadbalancerannotation.DefaultID() - lbac.mutation.SetID(v) - } -} - -// check runs all checks and user-defined validators on the builder. -func (lbac *LoadBalancerAnnotationCreate) check() error { - if _, ok := lbac.mutation.CreatedAt(); !ok { - return &ValidationError{Name: "created_at", err: errors.New(`generated: missing required field "LoadBalancerAnnotation.created_at"`)} - } - if _, ok := lbac.mutation.UpdatedAt(); !ok { - return &ValidationError{Name: "updated_at", err: errors.New(`generated: missing required field "LoadBalancerAnnotation.updated_at"`)} - } - if _, ok := lbac.mutation.LoadBalancerID(); !ok { - return &ValidationError{Name: "load_balancer_id", err: errors.New(`generated: missing required field "LoadBalancerAnnotation.load_balancer_id"`)} - } - if _, ok := lbac.mutation.LoadBalancerID(); !ok { - return &ValidationError{Name: "load_balancer", err: errors.New(`generated: missing required edge "LoadBalancerAnnotation.load_balancer"`)} - } - return nil -} - -func (lbac *LoadBalancerAnnotationCreate) sqlSave(ctx context.Context) (*LoadBalancerAnnotation, error) { - if err := lbac.check(); err != nil { - return nil, err - } - _node, _spec := lbac.createSpec() - if err := sqlgraph.CreateNode(ctx, lbac.driver, _spec); err != nil { - if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{msg: err.Error(), wrap: err} - } - return nil, err - } - if _spec.ID.Value != nil { - if id, ok := _spec.ID.Value.(*gidx.PrefixedID); ok { - _node.ID = *id - } else if err := _node.ID.Scan(_spec.ID.Value); err != nil { - return nil, err - } - } - lbac.mutation.id = &_node.ID - lbac.mutation.done = true - return _node, nil -} - -func (lbac *LoadBalancerAnnotationCreate) createSpec() (*LoadBalancerAnnotation, *sqlgraph.CreateSpec) { - var ( - _node = &LoadBalancerAnnotation{config: lbac.config} - _spec = sqlgraph.NewCreateSpec(loadbalancerannotation.Table, sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString)) - ) - if id, ok := lbac.mutation.ID(); ok { - _node.ID = id - _spec.ID.Value = &id - } - if value, ok := lbac.mutation.CreatedAt(); ok { - _spec.SetField(loadbalancerannotation.FieldCreatedAt, field.TypeTime, value) - _node.CreatedAt = value - } - if value, ok := lbac.mutation.UpdatedAt(); ok { - _spec.SetField(loadbalancerannotation.FieldUpdatedAt, field.TypeTime, value) - _node.UpdatedAt = value - } - if nodes := lbac.mutation.LoadBalancerIDs(); len(nodes) > 0 { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.M2O, - Inverse: false, - Table: loadbalancerannotation.LoadBalancerTable, - Columns: []string{loadbalancerannotation.LoadBalancerColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancer.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _node.LoadBalancerID = nodes[0] - _spec.Edges = append(_spec.Edges, edge) - } - return _node, _spec -} - -// LoadBalancerAnnotationCreateBulk is the builder for creating many LoadBalancerAnnotation entities in bulk. -type LoadBalancerAnnotationCreateBulk struct { - config - builders []*LoadBalancerAnnotationCreate -} - -// Save creates the LoadBalancerAnnotation entities in the database. -func (lbacb *LoadBalancerAnnotationCreateBulk) Save(ctx context.Context) ([]*LoadBalancerAnnotation, error) { - specs := make([]*sqlgraph.CreateSpec, len(lbacb.builders)) - nodes := make([]*LoadBalancerAnnotation, len(lbacb.builders)) - mutators := make([]Mutator, len(lbacb.builders)) - for i := range lbacb.builders { - func(i int, root context.Context) { - builder := lbacb.builders[i] - builder.defaults() - var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { - mutation, ok := m.(*LoadBalancerAnnotationMutation) - if !ok { - return nil, fmt.Errorf("unexpected mutation type %T", m) - } - if err := builder.check(); err != nil { - return nil, err - } - builder.mutation = mutation - var err error - nodes[i], specs[i] = builder.createSpec() - if i < len(mutators)-1 { - _, err = mutators[i+1].Mutate(root, lbacb.builders[i+1].mutation) - } else { - spec := &sqlgraph.BatchCreateSpec{Nodes: specs} - // Invoke the actual operation on the latest mutation in the chain. - if err = sqlgraph.BatchCreate(ctx, lbacb.driver, spec); err != nil { - if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{msg: err.Error(), wrap: err} - } - } - } - if err != nil { - return nil, err - } - mutation.id = &nodes[i].ID - mutation.done = true - return nodes[i], nil - }) - for i := len(builder.hooks) - 1; i >= 0; i-- { - mut = builder.hooks[i](mut) - } - mutators[i] = mut - }(i, ctx) - } - if len(mutators) > 0 { - if _, err := mutators[0].Mutate(ctx, lbacb.builders[0].mutation); err != nil { - return nil, err - } - } - return nodes, nil -} - -// SaveX is like Save, but panics if an error occurs. -func (lbacb *LoadBalancerAnnotationCreateBulk) SaveX(ctx context.Context) []*LoadBalancerAnnotation { - v, err := lbacb.Save(ctx) - if err != nil { - panic(err) - } - return v -} - -// Exec executes the query. -func (lbacb *LoadBalancerAnnotationCreateBulk) Exec(ctx context.Context) error { - _, err := lbacb.Save(ctx) - return err -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbacb *LoadBalancerAnnotationCreateBulk) ExecX(ctx context.Context) { - if err := lbacb.Exec(ctx); err != nil { - panic(err) - } -} diff --git a/internal/ent/generated/loadbalancerannotation_delete.go b/internal/ent/generated/loadbalancerannotation_delete.go deleted file mode 100644 index 6cce760b8..000000000 --- a/internal/ent/generated/loadbalancerannotation_delete.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package generated - -import ( - "context" - - "entgo.io/ent/dialect/sql" - "entgo.io/ent/dialect/sql/sqlgraph" - "entgo.io/ent/schema/field" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" -) - -// LoadBalancerAnnotationDelete is the builder for deleting a LoadBalancerAnnotation entity. -type LoadBalancerAnnotationDelete struct { - config - hooks []Hook - mutation *LoadBalancerAnnotationMutation -} - -// Where appends a list predicates to the LoadBalancerAnnotationDelete builder. -func (lbad *LoadBalancerAnnotationDelete) Where(ps ...predicate.LoadBalancerAnnotation) *LoadBalancerAnnotationDelete { - lbad.mutation.Where(ps...) - return lbad -} - -// Exec executes the deletion query and returns how many vertices were deleted. -func (lbad *LoadBalancerAnnotationDelete) Exec(ctx context.Context) (int, error) { - return withHooks(ctx, lbad.sqlExec, lbad.mutation, lbad.hooks) -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbad *LoadBalancerAnnotationDelete) ExecX(ctx context.Context) int { - n, err := lbad.Exec(ctx) - if err != nil { - panic(err) - } - return n -} - -func (lbad *LoadBalancerAnnotationDelete) sqlExec(ctx context.Context) (int, error) { - _spec := sqlgraph.NewDeleteSpec(loadbalancerannotation.Table, sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString)) - if ps := lbad.mutation.predicates; len(ps) > 0 { - _spec.Predicate = func(selector *sql.Selector) { - for i := range ps { - ps[i](selector) - } - } - } - affected, err := sqlgraph.DeleteNodes(ctx, lbad.driver, _spec) - if err != nil && sqlgraph.IsConstraintError(err) { - err = &ConstraintError{msg: err.Error(), wrap: err} - } - lbad.mutation.done = true - return affected, err -} - -// LoadBalancerAnnotationDeleteOne is the builder for deleting a single LoadBalancerAnnotation entity. -type LoadBalancerAnnotationDeleteOne struct { - lbad *LoadBalancerAnnotationDelete -} - -// Where appends a list predicates to the LoadBalancerAnnotationDelete builder. -func (lbado *LoadBalancerAnnotationDeleteOne) Where(ps ...predicate.LoadBalancerAnnotation) *LoadBalancerAnnotationDeleteOne { - lbado.lbad.mutation.Where(ps...) - return lbado -} - -// Exec executes the deletion query. -func (lbado *LoadBalancerAnnotationDeleteOne) Exec(ctx context.Context) error { - n, err := lbado.lbad.Exec(ctx) - switch { - case err != nil: - return err - case n == 0: - return &NotFoundError{loadbalancerannotation.Label} - default: - return nil - } -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbado *LoadBalancerAnnotationDeleteOne) ExecX(ctx context.Context) { - if err := lbado.Exec(ctx); err != nil { - panic(err) - } -} diff --git a/internal/ent/generated/loadbalancerannotation_query.go b/internal/ent/generated/loadbalancerannotation_query.go deleted file mode 100644 index 39fec53c9..000000000 --- a/internal/ent/generated/loadbalancerannotation_query.go +++ /dev/null @@ -1,623 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package generated - -import ( - "context" - "fmt" - "math" - - "entgo.io/ent/dialect/sql" - "entgo.io/ent/dialect/sql/sqlgraph" - "entgo.io/ent/schema/field" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" - "go.infratographer.com/x/gidx" -) - -// LoadBalancerAnnotationQuery is the builder for querying LoadBalancerAnnotation entities. -type LoadBalancerAnnotationQuery struct { - config - ctx *QueryContext - order []loadbalancerannotation.OrderOption - inters []Interceptor - predicates []predicate.LoadBalancerAnnotation - withLoadBalancer *LoadBalancerQuery - modifiers []func(*sql.Selector) - loadTotal []func(context.Context, []*LoadBalancerAnnotation) error - // intermediate query (i.e. traversal path). - sql *sql.Selector - path func(context.Context) (*sql.Selector, error) -} - -// Where adds a new predicate for the LoadBalancerAnnotationQuery builder. -func (lbaq *LoadBalancerAnnotationQuery) Where(ps ...predicate.LoadBalancerAnnotation) *LoadBalancerAnnotationQuery { - lbaq.predicates = append(lbaq.predicates, ps...) - return lbaq -} - -// Limit the number of records to be returned by this query. -func (lbaq *LoadBalancerAnnotationQuery) Limit(limit int) *LoadBalancerAnnotationQuery { - lbaq.ctx.Limit = &limit - return lbaq -} - -// Offset to start from. -func (lbaq *LoadBalancerAnnotationQuery) Offset(offset int) *LoadBalancerAnnotationQuery { - lbaq.ctx.Offset = &offset - return lbaq -} - -// Unique configures the query builder to filter duplicate records on query. -// By default, unique is set to true, and can be disabled using this method. -func (lbaq *LoadBalancerAnnotationQuery) Unique(unique bool) *LoadBalancerAnnotationQuery { - lbaq.ctx.Unique = &unique - return lbaq -} - -// Order specifies how the records should be ordered. -func (lbaq *LoadBalancerAnnotationQuery) Order(o ...loadbalancerannotation.OrderOption) *LoadBalancerAnnotationQuery { - lbaq.order = append(lbaq.order, o...) - return lbaq -} - -// QueryLoadBalancer chains the current query on the "load_balancer" edge. -func (lbaq *LoadBalancerAnnotationQuery) QueryLoadBalancer() *LoadBalancerQuery { - query := (&LoadBalancerClient{config: lbaq.config}).Query() - query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { - if err := lbaq.prepareQuery(ctx); err != nil { - return nil, err - } - selector := lbaq.sqlQuery(ctx) - if err := selector.Err(); err != nil { - return nil, err - } - step := sqlgraph.NewStep( - sqlgraph.From(loadbalancerannotation.Table, loadbalancerannotation.FieldID, selector), - sqlgraph.To(loadbalancer.Table, loadbalancer.FieldID), - sqlgraph.Edge(sqlgraph.M2O, false, loadbalancerannotation.LoadBalancerTable, loadbalancerannotation.LoadBalancerColumn), - ) - fromU = sqlgraph.SetNeighbors(lbaq.driver.Dialect(), step) - return fromU, nil - } - return query -} - -// First returns the first LoadBalancerAnnotation entity from the query. -// Returns a *NotFoundError when no LoadBalancerAnnotation was found. -func (lbaq *LoadBalancerAnnotationQuery) First(ctx context.Context) (*LoadBalancerAnnotation, error) { - nodes, err := lbaq.Limit(1).All(setContextOp(ctx, lbaq.ctx, "First")) - if err != nil { - return nil, err - } - if len(nodes) == 0 { - return nil, &NotFoundError{loadbalancerannotation.Label} - } - return nodes[0], nil -} - -// FirstX is like First, but panics if an error occurs. -func (lbaq *LoadBalancerAnnotationQuery) FirstX(ctx context.Context) *LoadBalancerAnnotation { - node, err := lbaq.First(ctx) - if err != nil && !IsNotFound(err) { - panic(err) - } - return node -} - -// FirstID returns the first LoadBalancerAnnotation ID from the query. -// Returns a *NotFoundError when no LoadBalancerAnnotation ID was found. -func (lbaq *LoadBalancerAnnotationQuery) FirstID(ctx context.Context) (id gidx.PrefixedID, err error) { - var ids []gidx.PrefixedID - if ids, err = lbaq.Limit(1).IDs(setContextOp(ctx, lbaq.ctx, "FirstID")); err != nil { - return - } - if len(ids) == 0 { - err = &NotFoundError{loadbalancerannotation.Label} - return - } - return ids[0], nil -} - -// FirstIDX is like FirstID, but panics if an error occurs. -func (lbaq *LoadBalancerAnnotationQuery) FirstIDX(ctx context.Context) gidx.PrefixedID { - id, err := lbaq.FirstID(ctx) - if err != nil && !IsNotFound(err) { - panic(err) - } - return id -} - -// Only returns a single LoadBalancerAnnotation entity found by the query, ensuring it only returns one. -// Returns a *NotSingularError when more than one LoadBalancerAnnotation entity is found. -// Returns a *NotFoundError when no LoadBalancerAnnotation entities are found. -func (lbaq *LoadBalancerAnnotationQuery) Only(ctx context.Context) (*LoadBalancerAnnotation, error) { - nodes, err := lbaq.Limit(2).All(setContextOp(ctx, lbaq.ctx, "Only")) - if err != nil { - return nil, err - } - switch len(nodes) { - case 1: - return nodes[0], nil - case 0: - return nil, &NotFoundError{loadbalancerannotation.Label} - default: - return nil, &NotSingularError{loadbalancerannotation.Label} - } -} - -// OnlyX is like Only, but panics if an error occurs. -func (lbaq *LoadBalancerAnnotationQuery) OnlyX(ctx context.Context) *LoadBalancerAnnotation { - node, err := lbaq.Only(ctx) - if err != nil { - panic(err) - } - return node -} - -// OnlyID is like Only, but returns the only LoadBalancerAnnotation ID in the query. -// Returns a *NotSingularError when more than one LoadBalancerAnnotation ID is found. -// Returns a *NotFoundError when no entities are found. -func (lbaq *LoadBalancerAnnotationQuery) OnlyID(ctx context.Context) (id gidx.PrefixedID, err error) { - var ids []gidx.PrefixedID - if ids, err = lbaq.Limit(2).IDs(setContextOp(ctx, lbaq.ctx, "OnlyID")); err != nil { - return - } - switch len(ids) { - case 1: - id = ids[0] - case 0: - err = &NotFoundError{loadbalancerannotation.Label} - default: - err = &NotSingularError{loadbalancerannotation.Label} - } - return -} - -// OnlyIDX is like OnlyID, but panics if an error occurs. -func (lbaq *LoadBalancerAnnotationQuery) OnlyIDX(ctx context.Context) gidx.PrefixedID { - id, err := lbaq.OnlyID(ctx) - if err != nil { - panic(err) - } - return id -} - -// All executes the query and returns a list of LoadBalancerAnnotations. -func (lbaq *LoadBalancerAnnotationQuery) All(ctx context.Context) ([]*LoadBalancerAnnotation, error) { - ctx = setContextOp(ctx, lbaq.ctx, "All") - if err := lbaq.prepareQuery(ctx); err != nil { - return nil, err - } - qr := querierAll[[]*LoadBalancerAnnotation, *LoadBalancerAnnotationQuery]() - return withInterceptors[[]*LoadBalancerAnnotation](ctx, lbaq, qr, lbaq.inters) -} - -// AllX is like All, but panics if an error occurs. -func (lbaq *LoadBalancerAnnotationQuery) AllX(ctx context.Context) []*LoadBalancerAnnotation { - nodes, err := lbaq.All(ctx) - if err != nil { - panic(err) - } - return nodes -} - -// IDs executes the query and returns a list of LoadBalancerAnnotation IDs. -func (lbaq *LoadBalancerAnnotationQuery) IDs(ctx context.Context) (ids []gidx.PrefixedID, err error) { - if lbaq.ctx.Unique == nil && lbaq.path != nil { - lbaq.Unique(true) - } - ctx = setContextOp(ctx, lbaq.ctx, "IDs") - if err = lbaq.Select(loadbalancerannotation.FieldID).Scan(ctx, &ids); err != nil { - return nil, err - } - return ids, nil -} - -// IDsX is like IDs, but panics if an error occurs. -func (lbaq *LoadBalancerAnnotationQuery) IDsX(ctx context.Context) []gidx.PrefixedID { - ids, err := lbaq.IDs(ctx) - if err != nil { - panic(err) - } - return ids -} - -// Count returns the count of the given query. -func (lbaq *LoadBalancerAnnotationQuery) Count(ctx context.Context) (int, error) { - ctx = setContextOp(ctx, lbaq.ctx, "Count") - if err := lbaq.prepareQuery(ctx); err != nil { - return 0, err - } - return withInterceptors[int](ctx, lbaq, querierCount[*LoadBalancerAnnotationQuery](), lbaq.inters) -} - -// CountX is like Count, but panics if an error occurs. -func (lbaq *LoadBalancerAnnotationQuery) CountX(ctx context.Context) int { - count, err := lbaq.Count(ctx) - if err != nil { - panic(err) - } - return count -} - -// Exist returns true if the query has elements in the graph. -func (lbaq *LoadBalancerAnnotationQuery) Exist(ctx context.Context) (bool, error) { - ctx = setContextOp(ctx, lbaq.ctx, "Exist") - switch _, err := lbaq.FirstID(ctx); { - case IsNotFound(err): - return false, nil - case err != nil: - return false, fmt.Errorf("generated: check existence: %w", err) - default: - return true, nil - } -} - -// ExistX is like Exist, but panics if an error occurs. -func (lbaq *LoadBalancerAnnotationQuery) ExistX(ctx context.Context) bool { - exist, err := lbaq.Exist(ctx) - if err != nil { - panic(err) - } - return exist -} - -// Clone returns a duplicate of the LoadBalancerAnnotationQuery builder, including all associated steps. It can be -// used to prepare common query builders and use them differently after the clone is made. -func (lbaq *LoadBalancerAnnotationQuery) Clone() *LoadBalancerAnnotationQuery { - if lbaq == nil { - return nil - } - return &LoadBalancerAnnotationQuery{ - config: lbaq.config, - ctx: lbaq.ctx.Clone(), - order: append([]loadbalancerannotation.OrderOption{}, lbaq.order...), - inters: append([]Interceptor{}, lbaq.inters...), - predicates: append([]predicate.LoadBalancerAnnotation{}, lbaq.predicates...), - withLoadBalancer: lbaq.withLoadBalancer.Clone(), - // clone intermediate query. - sql: lbaq.sql.Clone(), - path: lbaq.path, - } -} - -// WithLoadBalancer tells the query-builder to eager-load the nodes that are connected to -// the "load_balancer" edge. The optional arguments are used to configure the query builder of the edge. -func (lbaq *LoadBalancerAnnotationQuery) WithLoadBalancer(opts ...func(*LoadBalancerQuery)) *LoadBalancerAnnotationQuery { - query := (&LoadBalancerClient{config: lbaq.config}).Query() - for _, opt := range opts { - opt(query) - } - lbaq.withLoadBalancer = query - return lbaq -} - -// GroupBy is used to group vertices by one or more fields/columns. -// It is often used with aggregate functions, like: count, max, mean, min, sum. -// -// Example: -// -// var v []struct { -// CreatedAt time.Time `json:"created_at,omitempty"` -// Count int `json:"count,omitempty"` -// } -// -// client.LoadBalancerAnnotation.Query(). -// GroupBy(loadbalancerannotation.FieldCreatedAt). -// Aggregate(generated.Count()). -// Scan(ctx, &v) -func (lbaq *LoadBalancerAnnotationQuery) GroupBy(field string, fields ...string) *LoadBalancerAnnotationGroupBy { - lbaq.ctx.Fields = append([]string{field}, fields...) - grbuild := &LoadBalancerAnnotationGroupBy{build: lbaq} - grbuild.flds = &lbaq.ctx.Fields - grbuild.label = loadbalancerannotation.Label - grbuild.scan = grbuild.Scan - return grbuild -} - -// Select allows the selection one or more fields/columns for the given query, -// instead of selecting all fields in the entity. -// -// Example: -// -// var v []struct { -// CreatedAt time.Time `json:"created_at,omitempty"` -// } -// -// client.LoadBalancerAnnotation.Query(). -// Select(loadbalancerannotation.FieldCreatedAt). -// Scan(ctx, &v) -func (lbaq *LoadBalancerAnnotationQuery) Select(fields ...string) *LoadBalancerAnnotationSelect { - lbaq.ctx.Fields = append(lbaq.ctx.Fields, fields...) - sbuild := &LoadBalancerAnnotationSelect{LoadBalancerAnnotationQuery: lbaq} - sbuild.label = loadbalancerannotation.Label - sbuild.flds, sbuild.scan = &lbaq.ctx.Fields, sbuild.Scan - return sbuild -} - -// Aggregate returns a LoadBalancerAnnotationSelect configured with the given aggregations. -func (lbaq *LoadBalancerAnnotationQuery) Aggregate(fns ...AggregateFunc) *LoadBalancerAnnotationSelect { - return lbaq.Select().Aggregate(fns...) -} - -func (lbaq *LoadBalancerAnnotationQuery) prepareQuery(ctx context.Context) error { - for _, inter := range lbaq.inters { - if inter == nil { - return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") - } - if trv, ok := inter.(Traverser); ok { - if err := trv.Traverse(ctx, lbaq); err != nil { - return err - } - } - } - for _, f := range lbaq.ctx.Fields { - if !loadbalancerannotation.ValidColumn(f) { - return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} - } - } - if lbaq.path != nil { - prev, err := lbaq.path(ctx) - if err != nil { - return err - } - lbaq.sql = prev - } - return nil -} - -func (lbaq *LoadBalancerAnnotationQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*LoadBalancerAnnotation, error) { - var ( - nodes = []*LoadBalancerAnnotation{} - _spec = lbaq.querySpec() - loadedTypes = [1]bool{ - lbaq.withLoadBalancer != nil, - } - ) - _spec.ScanValues = func(columns []string) ([]any, error) { - return (*LoadBalancerAnnotation).scanValues(nil, columns) - } - _spec.Assign = func(columns []string, values []any) error { - node := &LoadBalancerAnnotation{config: lbaq.config} - nodes = append(nodes, node) - node.Edges.loadedTypes = loadedTypes - return node.assignValues(columns, values) - } - if len(lbaq.modifiers) > 0 { - _spec.Modifiers = lbaq.modifiers - } - for i := range hooks { - hooks[i](ctx, _spec) - } - if err := sqlgraph.QueryNodes(ctx, lbaq.driver, _spec); err != nil { - return nil, err - } - if len(nodes) == 0 { - return nodes, nil - } - if query := lbaq.withLoadBalancer; query != nil { - if err := lbaq.loadLoadBalancer(ctx, query, nodes, nil, - func(n *LoadBalancerAnnotation, e *LoadBalancer) { n.Edges.LoadBalancer = e }); err != nil { - return nil, err - } - } - for i := range lbaq.loadTotal { - if err := lbaq.loadTotal[i](ctx, nodes); err != nil { - return nil, err - } - } - return nodes, nil -} - -func (lbaq *LoadBalancerAnnotationQuery) loadLoadBalancer(ctx context.Context, query *LoadBalancerQuery, nodes []*LoadBalancerAnnotation, init func(*LoadBalancerAnnotation), assign func(*LoadBalancerAnnotation, *LoadBalancer)) error { - ids := make([]gidx.PrefixedID, 0, len(nodes)) - nodeids := make(map[gidx.PrefixedID][]*LoadBalancerAnnotation) - for i := range nodes { - fk := nodes[i].LoadBalancerID - if _, ok := nodeids[fk]; !ok { - ids = append(ids, fk) - } - nodeids[fk] = append(nodeids[fk], nodes[i]) - } - if len(ids) == 0 { - return nil - } - query.Where(loadbalancer.IDIn(ids...)) - neighbors, err := query.All(ctx) - if err != nil { - return err - } - for _, n := range neighbors { - nodes, ok := nodeids[n.ID] - if !ok { - return fmt.Errorf(`unexpected foreign-key "load_balancer_id" returned %v`, n.ID) - } - for i := range nodes { - assign(nodes[i], n) - } - } - return nil -} - -func (lbaq *LoadBalancerAnnotationQuery) sqlCount(ctx context.Context) (int, error) { - _spec := lbaq.querySpec() - if len(lbaq.modifiers) > 0 { - _spec.Modifiers = lbaq.modifiers - } - _spec.Node.Columns = lbaq.ctx.Fields - if len(lbaq.ctx.Fields) > 0 { - _spec.Unique = lbaq.ctx.Unique != nil && *lbaq.ctx.Unique - } - return sqlgraph.CountNodes(ctx, lbaq.driver, _spec) -} - -func (lbaq *LoadBalancerAnnotationQuery) querySpec() *sqlgraph.QuerySpec { - _spec := sqlgraph.NewQuerySpec(loadbalancerannotation.Table, loadbalancerannotation.Columns, sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString)) - _spec.From = lbaq.sql - if unique := lbaq.ctx.Unique; unique != nil { - _spec.Unique = *unique - } else if lbaq.path != nil { - _spec.Unique = true - } - if fields := lbaq.ctx.Fields; len(fields) > 0 { - _spec.Node.Columns = make([]string, 0, len(fields)) - _spec.Node.Columns = append(_spec.Node.Columns, loadbalancerannotation.FieldID) - for i := range fields { - if fields[i] != loadbalancerannotation.FieldID { - _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) - } - } - if lbaq.withLoadBalancer != nil { - _spec.Node.AddColumnOnce(loadbalancerannotation.FieldLoadBalancerID) - } - } - if ps := lbaq.predicates; len(ps) > 0 { - _spec.Predicate = func(selector *sql.Selector) { - for i := range ps { - ps[i](selector) - } - } - } - if limit := lbaq.ctx.Limit; limit != nil { - _spec.Limit = *limit - } - if offset := lbaq.ctx.Offset; offset != nil { - _spec.Offset = *offset - } - if ps := lbaq.order; len(ps) > 0 { - _spec.Order = func(selector *sql.Selector) { - for i := range ps { - ps[i](selector) - } - } - } - return _spec -} - -func (lbaq *LoadBalancerAnnotationQuery) sqlQuery(ctx context.Context) *sql.Selector { - builder := sql.Dialect(lbaq.driver.Dialect()) - t1 := builder.Table(loadbalancerannotation.Table) - columns := lbaq.ctx.Fields - if len(columns) == 0 { - columns = loadbalancerannotation.Columns - } - selector := builder.Select(t1.Columns(columns...)...).From(t1) - if lbaq.sql != nil { - selector = lbaq.sql - selector.Select(selector.Columns(columns...)...) - } - if lbaq.ctx.Unique != nil && *lbaq.ctx.Unique { - selector.Distinct() - } - for _, p := range lbaq.predicates { - p(selector) - } - for _, p := range lbaq.order { - p(selector) - } - if offset := lbaq.ctx.Offset; offset != nil { - // limit is mandatory for offset clause. We start - // with default value, and override it below if needed. - selector.Offset(*offset).Limit(math.MaxInt32) - } - if limit := lbaq.ctx.Limit; limit != nil { - selector.Limit(*limit) - } - return selector -} - -// LoadBalancerAnnotationGroupBy is the group-by builder for LoadBalancerAnnotation entities. -type LoadBalancerAnnotationGroupBy struct { - selector - build *LoadBalancerAnnotationQuery -} - -// Aggregate adds the given aggregation functions to the group-by query. -func (lbagb *LoadBalancerAnnotationGroupBy) Aggregate(fns ...AggregateFunc) *LoadBalancerAnnotationGroupBy { - lbagb.fns = append(lbagb.fns, fns...) - return lbagb -} - -// Scan applies the selector query and scans the result into the given value. -func (lbagb *LoadBalancerAnnotationGroupBy) Scan(ctx context.Context, v any) error { - ctx = setContextOp(ctx, lbagb.build.ctx, "GroupBy") - if err := lbagb.build.prepareQuery(ctx); err != nil { - return err - } - return scanWithInterceptors[*LoadBalancerAnnotationQuery, *LoadBalancerAnnotationGroupBy](ctx, lbagb.build, lbagb, lbagb.build.inters, v) -} - -func (lbagb *LoadBalancerAnnotationGroupBy) sqlScan(ctx context.Context, root *LoadBalancerAnnotationQuery, v any) error { - selector := root.sqlQuery(ctx).Select() - aggregation := make([]string, 0, len(lbagb.fns)) - for _, fn := range lbagb.fns { - aggregation = append(aggregation, fn(selector)) - } - if len(selector.SelectedColumns()) == 0 { - columns := make([]string, 0, len(*lbagb.flds)+len(lbagb.fns)) - for _, f := range *lbagb.flds { - columns = append(columns, selector.C(f)) - } - columns = append(columns, aggregation...) - selector.Select(columns...) - } - selector.GroupBy(selector.Columns(*lbagb.flds...)...) - if err := selector.Err(); err != nil { - return err - } - rows := &sql.Rows{} - query, args := selector.Query() - if err := lbagb.build.driver.Query(ctx, query, args, rows); err != nil { - return err - } - defer rows.Close() - return sql.ScanSlice(rows, v) -} - -// LoadBalancerAnnotationSelect is the builder for selecting fields of LoadBalancerAnnotation entities. -type LoadBalancerAnnotationSelect struct { - *LoadBalancerAnnotationQuery - selector -} - -// Aggregate adds the given aggregation functions to the selector query. -func (lbas *LoadBalancerAnnotationSelect) Aggregate(fns ...AggregateFunc) *LoadBalancerAnnotationSelect { - lbas.fns = append(lbas.fns, fns...) - return lbas -} - -// Scan applies the selector query and scans the result into the given value. -func (lbas *LoadBalancerAnnotationSelect) Scan(ctx context.Context, v any) error { - ctx = setContextOp(ctx, lbas.ctx, "Select") - if err := lbas.prepareQuery(ctx); err != nil { - return err - } - return scanWithInterceptors[*LoadBalancerAnnotationQuery, *LoadBalancerAnnotationSelect](ctx, lbas.LoadBalancerAnnotationQuery, lbas, lbas.inters, v) -} - -func (lbas *LoadBalancerAnnotationSelect) sqlScan(ctx context.Context, root *LoadBalancerAnnotationQuery, v any) error { - selector := root.sqlQuery(ctx) - aggregation := make([]string, 0, len(lbas.fns)) - for _, fn := range lbas.fns { - aggregation = append(aggregation, fn(selector)) - } - switch n := len(*lbas.selector.flds); { - case n == 0 && len(aggregation) > 0: - selector.Select(aggregation...) - case n != 0 && len(aggregation) > 0: - selector.AppendSelect(aggregation...) - } - rows := &sql.Rows{} - query, args := selector.Query() - if err := lbas.driver.Query(ctx, query, args, rows); err != nil { - return err - } - defer rows.Close() - return sql.ScanSlice(rows, v) -} diff --git a/internal/ent/generated/loadbalancerannotation_update.go b/internal/ent/generated/loadbalancerannotation_update.go deleted file mode 100644 index 1fe05ab10..000000000 --- a/internal/ent/generated/loadbalancerannotation_update.go +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package generated - -import ( - "context" - "errors" - "fmt" - - "entgo.io/ent/dialect/sql" - "entgo.io/ent/dialect/sql/sqlgraph" - "entgo.io/ent/schema/field" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" -) - -// LoadBalancerAnnotationUpdate is the builder for updating LoadBalancerAnnotation entities. -type LoadBalancerAnnotationUpdate struct { - config - hooks []Hook - mutation *LoadBalancerAnnotationMutation -} - -// Where appends a list predicates to the LoadBalancerAnnotationUpdate builder. -func (lbau *LoadBalancerAnnotationUpdate) Where(ps ...predicate.LoadBalancerAnnotation) *LoadBalancerAnnotationUpdate { - lbau.mutation.Where(ps...) - return lbau -} - -// Mutation returns the LoadBalancerAnnotationMutation object of the builder. -func (lbau *LoadBalancerAnnotationUpdate) Mutation() *LoadBalancerAnnotationMutation { - return lbau.mutation -} - -// Save executes the query and returns the number of nodes affected by the update operation. -func (lbau *LoadBalancerAnnotationUpdate) Save(ctx context.Context) (int, error) { - lbau.defaults() - return withHooks(ctx, lbau.sqlSave, lbau.mutation, lbau.hooks) -} - -// SaveX is like Save, but panics if an error occurs. -func (lbau *LoadBalancerAnnotationUpdate) SaveX(ctx context.Context) int { - affected, err := lbau.Save(ctx) - if err != nil { - panic(err) - } - return affected -} - -// Exec executes the query. -func (lbau *LoadBalancerAnnotationUpdate) Exec(ctx context.Context) error { - _, err := lbau.Save(ctx) - return err -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbau *LoadBalancerAnnotationUpdate) ExecX(ctx context.Context) { - if err := lbau.Exec(ctx); err != nil { - panic(err) - } -} - -// defaults sets the default values of the builder before save. -func (lbau *LoadBalancerAnnotationUpdate) defaults() { - if _, ok := lbau.mutation.UpdatedAt(); !ok { - v := loadbalancerannotation.UpdateDefaultUpdatedAt() - lbau.mutation.SetUpdatedAt(v) - } -} - -// check runs all checks and user-defined validators on the builder. -func (lbau *LoadBalancerAnnotationUpdate) check() error { - if _, ok := lbau.mutation.LoadBalancerID(); lbau.mutation.LoadBalancerCleared() && !ok { - return errors.New(`generated: clearing a required unique edge "LoadBalancerAnnotation.load_balancer"`) - } - return nil -} - -func (lbau *LoadBalancerAnnotationUpdate) sqlSave(ctx context.Context) (n int, err error) { - if err := lbau.check(); err != nil { - return n, err - } - _spec := sqlgraph.NewUpdateSpec(loadbalancerannotation.Table, loadbalancerannotation.Columns, sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString)) - if ps := lbau.mutation.predicates; len(ps) > 0 { - _spec.Predicate = func(selector *sql.Selector) { - for i := range ps { - ps[i](selector) - } - } - } - if value, ok := lbau.mutation.UpdatedAt(); ok { - _spec.SetField(loadbalancerannotation.FieldUpdatedAt, field.TypeTime, value) - } - if n, err = sqlgraph.UpdateNodes(ctx, lbau.driver, _spec); err != nil { - if _, ok := err.(*sqlgraph.NotFoundError); ok { - err = &NotFoundError{loadbalancerannotation.Label} - } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{msg: err.Error(), wrap: err} - } - return 0, err - } - lbau.mutation.done = true - return n, nil -} - -// LoadBalancerAnnotationUpdateOne is the builder for updating a single LoadBalancerAnnotation entity. -type LoadBalancerAnnotationUpdateOne struct { - config - fields []string - hooks []Hook - mutation *LoadBalancerAnnotationMutation -} - -// Mutation returns the LoadBalancerAnnotationMutation object of the builder. -func (lbauo *LoadBalancerAnnotationUpdateOne) Mutation() *LoadBalancerAnnotationMutation { - return lbauo.mutation -} - -// Where appends a list predicates to the LoadBalancerAnnotationUpdate builder. -func (lbauo *LoadBalancerAnnotationUpdateOne) Where(ps ...predicate.LoadBalancerAnnotation) *LoadBalancerAnnotationUpdateOne { - lbauo.mutation.Where(ps...) - return lbauo -} - -// Select allows selecting one or more fields (columns) of the returned entity. -// The default is selecting all fields defined in the entity schema. -func (lbauo *LoadBalancerAnnotationUpdateOne) Select(field string, fields ...string) *LoadBalancerAnnotationUpdateOne { - lbauo.fields = append([]string{field}, fields...) - return lbauo -} - -// Save executes the query and returns the updated LoadBalancerAnnotation entity. -func (lbauo *LoadBalancerAnnotationUpdateOne) Save(ctx context.Context) (*LoadBalancerAnnotation, error) { - lbauo.defaults() - return withHooks(ctx, lbauo.sqlSave, lbauo.mutation, lbauo.hooks) -} - -// SaveX is like Save, but panics if an error occurs. -func (lbauo *LoadBalancerAnnotationUpdateOne) SaveX(ctx context.Context) *LoadBalancerAnnotation { - node, err := lbauo.Save(ctx) - if err != nil { - panic(err) - } - return node -} - -// Exec executes the query on the entity. -func (lbauo *LoadBalancerAnnotationUpdateOne) Exec(ctx context.Context) error { - _, err := lbauo.Save(ctx) - return err -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbauo *LoadBalancerAnnotationUpdateOne) ExecX(ctx context.Context) { - if err := lbauo.Exec(ctx); err != nil { - panic(err) - } -} - -// defaults sets the default values of the builder before save. -func (lbauo *LoadBalancerAnnotationUpdateOne) defaults() { - if _, ok := lbauo.mutation.UpdatedAt(); !ok { - v := loadbalancerannotation.UpdateDefaultUpdatedAt() - lbauo.mutation.SetUpdatedAt(v) - } -} - -// check runs all checks and user-defined validators on the builder. -func (lbauo *LoadBalancerAnnotationUpdateOne) check() error { - if _, ok := lbauo.mutation.LoadBalancerID(); lbauo.mutation.LoadBalancerCleared() && !ok { - return errors.New(`generated: clearing a required unique edge "LoadBalancerAnnotation.load_balancer"`) - } - return nil -} - -func (lbauo *LoadBalancerAnnotationUpdateOne) sqlSave(ctx context.Context) (_node *LoadBalancerAnnotation, err error) { - if err := lbauo.check(); err != nil { - return _node, err - } - _spec := sqlgraph.NewUpdateSpec(loadbalancerannotation.Table, loadbalancerannotation.Columns, sqlgraph.NewFieldSpec(loadbalancerannotation.FieldID, field.TypeString)) - id, ok := lbauo.mutation.ID() - if !ok { - return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "LoadBalancerAnnotation.id" for update`)} - } - _spec.Node.ID.Value = id - if fields := lbauo.fields; len(fields) > 0 { - _spec.Node.Columns = make([]string, 0, len(fields)) - _spec.Node.Columns = append(_spec.Node.Columns, loadbalancerannotation.FieldID) - for _, f := range fields { - if !loadbalancerannotation.ValidColumn(f) { - return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} - } - if f != loadbalancerannotation.FieldID { - _spec.Node.Columns = append(_spec.Node.Columns, f) - } - } - } - if ps := lbauo.mutation.predicates; len(ps) > 0 { - _spec.Predicate = func(selector *sql.Selector) { - for i := range ps { - ps[i](selector) - } - } - } - if value, ok := lbauo.mutation.UpdatedAt(); ok { - _spec.SetField(loadbalancerannotation.FieldUpdatedAt, field.TypeTime, value) - } - _node = &LoadBalancerAnnotation{config: lbauo.config} - _spec.Assign = _node.assignValues - _spec.ScanValues = _node.scanValues - if err = sqlgraph.UpdateNode(ctx, lbauo.driver, _spec); err != nil { - if _, ok := err.(*sqlgraph.NotFoundError); ok { - err = &NotFoundError{loadbalancerannotation.Label} - } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{msg: err.Error(), wrap: err} - } - return nil, err - } - lbauo.mutation.done = true - return _node, nil -} diff --git a/internal/ent/generated/loadbalancerstatus.go b/internal/ent/generated/loadbalancerstatus.go deleted file mode 100644 index 8c6c7cc34..000000000 --- a/internal/ent/generated/loadbalancerstatus.go +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package generated - -import ( - "fmt" - "strings" - "time" - - "entgo.io/ent" - "entgo.io/ent/dialect/sql" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" - "go.infratographer.com/x/gidx" -) - -// LoadBalancerStatus is the model entity for the LoadBalancerStatus schema. -type LoadBalancerStatus struct { - config `json:"-"` - // ID of the ent. - ID gidx.PrefixedID `json:"id,omitempty"` - // CreatedAt holds the value of the "created_at" field. - CreatedAt time.Time `json:"created_at,omitempty"` - // UpdatedAt holds the value of the "updated_at" field. - UpdatedAt time.Time `json:"updated_at,omitempty"` - // LoadBalancerID holds the value of the "load_balancer_id" field. - LoadBalancerID gidx.PrefixedID `json:"load_balancer_id,omitempty"` - // Source holds the value of the "source" field. - Source string `json:"source,omitempty"` - // Edges holds the relations/edges for other nodes in the graph. - // The values are being populated by the LoadBalancerStatusQuery when eager-loading is set. - Edges LoadBalancerStatusEdges `json:"edges"` - selectValues sql.SelectValues -} - -// LoadBalancerStatusEdges holds the relations/edges for other nodes in the graph. -type LoadBalancerStatusEdges struct { - // LoadBalancer holds the value of the load_balancer edge. - LoadBalancer *LoadBalancer `json:"load_balancer,omitempty"` - // loadedTypes holds the information for reporting if a - // type was loaded (or requested) in eager-loading or not. - loadedTypes [1]bool - // totalCount holds the count of the edges above. - totalCount [1]map[string]int -} - -// LoadBalancerOrErr returns the LoadBalancer value or an error if the edge -// was not loaded in eager-loading, or loaded but was not found. -func (e LoadBalancerStatusEdges) LoadBalancerOrErr() (*LoadBalancer, error) { - if e.loadedTypes[0] { - if e.LoadBalancer == nil { - // Edge was loaded but was not found. - return nil, &NotFoundError{label: loadbalancer.Label} - } - return e.LoadBalancer, nil - } - return nil, &NotLoadedError{edge: "load_balancer"} -} - -// scanValues returns the types for scanning values from sql.Rows. -func (*LoadBalancerStatus) scanValues(columns []string) ([]any, error) { - values := make([]any, len(columns)) - for i := range columns { - switch columns[i] { - case loadbalancerstatus.FieldID, loadbalancerstatus.FieldLoadBalancerID: - values[i] = new(gidx.PrefixedID) - case loadbalancerstatus.FieldSource: - values[i] = new(sql.NullString) - case loadbalancerstatus.FieldCreatedAt, loadbalancerstatus.FieldUpdatedAt: - values[i] = new(sql.NullTime) - default: - values[i] = new(sql.UnknownType) - } - } - return values, nil -} - -// assignValues assigns the values that were returned from sql.Rows (after scanning) -// to the LoadBalancerStatus fields. -func (lbs *LoadBalancerStatus) assignValues(columns []string, values []any) error { - if m, n := len(values), len(columns); m < n { - return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) - } - for i := range columns { - switch columns[i] { - case loadbalancerstatus.FieldID: - if value, ok := values[i].(*gidx.PrefixedID); !ok { - return fmt.Errorf("unexpected type %T for field id", values[i]) - } else if value != nil { - lbs.ID = *value - } - case loadbalancerstatus.FieldCreatedAt: - if value, ok := values[i].(*sql.NullTime); !ok { - return fmt.Errorf("unexpected type %T for field created_at", values[i]) - } else if value.Valid { - lbs.CreatedAt = value.Time - } - case loadbalancerstatus.FieldUpdatedAt: - if value, ok := values[i].(*sql.NullTime); !ok { - return fmt.Errorf("unexpected type %T for field updated_at", values[i]) - } else if value.Valid { - lbs.UpdatedAt = value.Time - } - case loadbalancerstatus.FieldLoadBalancerID: - if value, ok := values[i].(*gidx.PrefixedID); !ok { - return fmt.Errorf("unexpected type %T for field load_balancer_id", values[i]) - } else if value != nil { - lbs.LoadBalancerID = *value - } - case loadbalancerstatus.FieldSource: - if value, ok := values[i].(*sql.NullString); !ok { - return fmt.Errorf("unexpected type %T for field source", values[i]) - } else if value.Valid { - lbs.Source = value.String - } - default: - lbs.selectValues.Set(columns[i], values[i]) - } - } - return nil -} - -// Value returns the ent.Value that was dynamically selected and assigned to the LoadBalancerStatus. -// This includes values selected through modifiers, order, etc. -func (lbs *LoadBalancerStatus) Value(name string) (ent.Value, error) { - return lbs.selectValues.Get(name) -} - -// QueryLoadBalancer queries the "load_balancer" edge of the LoadBalancerStatus entity. -func (lbs *LoadBalancerStatus) QueryLoadBalancer() *LoadBalancerQuery { - return NewLoadBalancerStatusClient(lbs.config).QueryLoadBalancer(lbs) -} - -// Update returns a builder for updating this LoadBalancerStatus. -// Note that you need to call LoadBalancerStatus.Unwrap() before calling this method if this LoadBalancerStatus -// was returned from a transaction, and the transaction was committed or rolled back. -func (lbs *LoadBalancerStatus) Update() *LoadBalancerStatusUpdateOne { - return NewLoadBalancerStatusClient(lbs.config).UpdateOne(lbs) -} - -// Unwrap unwraps the LoadBalancerStatus entity that was returned from a transaction after it was closed, -// so that all future queries will be executed through the driver which created the transaction. -func (lbs *LoadBalancerStatus) Unwrap() *LoadBalancerStatus { - _tx, ok := lbs.config.driver.(*txDriver) - if !ok { - panic("generated: LoadBalancerStatus is not a transactional entity") - } - lbs.config.driver = _tx.drv - return lbs -} - -// String implements the fmt.Stringer. -func (lbs *LoadBalancerStatus) String() string { - var builder strings.Builder - builder.WriteString("LoadBalancerStatus(") - builder.WriteString(fmt.Sprintf("id=%v, ", lbs.ID)) - builder.WriteString("created_at=") - builder.WriteString(lbs.CreatedAt.Format(time.ANSIC)) - builder.WriteString(", ") - builder.WriteString("updated_at=") - builder.WriteString(lbs.UpdatedAt.Format(time.ANSIC)) - builder.WriteString(", ") - builder.WriteString("load_balancer_id=") - builder.WriteString(fmt.Sprintf("%v", lbs.LoadBalancerID)) - builder.WriteString(", ") - builder.WriteString("source=") - builder.WriteString(lbs.Source) - builder.WriteByte(')') - return builder.String() -} - -// IsEntity implement fedruntime.Entity -func (lbs LoadBalancerStatus) IsEntity() {} - -// LoadBalancerStatusSlice is a parsable slice of LoadBalancerStatus. -type LoadBalancerStatusSlice []*LoadBalancerStatus diff --git a/internal/ent/generated/loadbalancerstatus/loadbalancerstatus.go b/internal/ent/generated/loadbalancerstatus/loadbalancerstatus.go deleted file mode 100644 index 9b1693902..000000000 --- a/internal/ent/generated/loadbalancerstatus/loadbalancerstatus.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package loadbalancerstatus - -import ( - "time" - - "entgo.io/ent/dialect/sql" - "entgo.io/ent/dialect/sql/sqlgraph" - "go.infratographer.com/x/gidx" -) - -const ( - // Label holds the string label denoting the loadbalancerstatus type in the database. - Label = "load_balancer_status" - // FieldID holds the string denoting the id field in the database. - FieldID = "id" - // FieldCreatedAt holds the string denoting the created_at field in the database. - FieldCreatedAt = "created_at" - // FieldUpdatedAt holds the string denoting the updated_at field in the database. - FieldUpdatedAt = "updated_at" - // FieldLoadBalancerID holds the string denoting the load_balancer_id field in the database. - FieldLoadBalancerID = "load_balancer_id" - // FieldSource holds the string denoting the source field in the database. - FieldSource = "source" - // EdgeLoadBalancer holds the string denoting the load_balancer edge name in mutations. - EdgeLoadBalancer = "load_balancer" - // Table holds the table name of the loadbalancerstatus in the database. - Table = "load_balancer_status" - // LoadBalancerTable is the table that holds the load_balancer relation/edge. - LoadBalancerTable = "load_balancer_status" - // LoadBalancerInverseTable is the table name for the LoadBalancer entity. - // It exists in this package in order to avoid circular dependency with the "loadbalancer" package. - LoadBalancerInverseTable = "load_balancers" - // LoadBalancerColumn is the table column denoting the load_balancer relation/edge. - LoadBalancerColumn = "load_balancer_id" -) - -// Columns holds all SQL columns for loadbalancerstatus fields. -var Columns = []string{ - FieldID, - FieldCreatedAt, - FieldUpdatedAt, - FieldLoadBalancerID, - FieldSource, -} - -// ValidColumn reports if the column name is valid (part of the table columns). -func ValidColumn(column string) bool { - for i := range Columns { - if column == Columns[i] { - return true - } - } - return false -} - -var ( - // 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. - DefaultUpdatedAt func() time.Time - // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. - UpdateDefaultUpdatedAt func() time.Time - // SourceValidator is a validator for the "source" field. It is called by the builders before save. - SourceValidator func(string) error - // DefaultID holds the default value on creation for the "id" field. - DefaultID func() gidx.PrefixedID -) - -// OrderOption defines the ordering options for the LoadBalancerStatus queries. -type OrderOption func(*sql.Selector) - -// ByID orders the results by the id field. -func ByID(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldID, opts...).ToFunc() -} - -// ByCreatedAt orders the results by the created_at field. -func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() -} - -// ByUpdatedAt orders the results by the updated_at field. -func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() -} - -// ByLoadBalancerID orders the results by the load_balancer_id field. -func ByLoadBalancerID(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldLoadBalancerID, opts...).ToFunc() -} - -// BySource orders the results by the source field. -func BySource(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldSource, opts...).ToFunc() -} - -// ByLoadBalancerField orders the results by load_balancer field. -func ByLoadBalancerField(field string, opts ...sql.OrderTermOption) OrderOption { - return func(s *sql.Selector) { - sqlgraph.OrderByNeighborTerms(s, newLoadBalancerStep(), sql.OrderByField(field, opts...)) - } -} -func newLoadBalancerStep() *sqlgraph.Step { - return sqlgraph.NewStep( - sqlgraph.From(Table, FieldID), - sqlgraph.To(LoadBalancerInverseTable, FieldID), - sqlgraph.Edge(sqlgraph.M2O, false, LoadBalancerTable, LoadBalancerColumn), - ) -} diff --git a/internal/ent/generated/loadbalancerstatus/where.go b/internal/ent/generated/loadbalancerstatus/where.go deleted file mode 100644 index e590fcf17..000000000 --- a/internal/ent/generated/loadbalancerstatus/where.go +++ /dev/null @@ -1,351 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package loadbalancerstatus - -import ( - "time" - - "entgo.io/ent/dialect/sql" - "entgo.io/ent/dialect/sql/sqlgraph" - "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" - "go.infratographer.com/x/gidx" -) - -// ID filters vertices based on their ID field. -func ID(id gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldEQ(FieldID, id)) -} - -// IDEQ applies the EQ predicate on the ID field. -func IDEQ(id gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldEQ(FieldID, id)) -} - -// IDNEQ applies the NEQ predicate on the ID field. -func IDNEQ(id gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldNEQ(FieldID, id)) -} - -// IDIn applies the In predicate on the ID field. -func IDIn(ids ...gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldIn(FieldID, ids...)) -} - -// IDNotIn applies the NotIn predicate on the ID field. -func IDNotIn(ids ...gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldNotIn(FieldID, ids...)) -} - -// IDGT applies the GT predicate on the ID field. -func IDGT(id gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldGT(FieldID, id)) -} - -// IDGTE applies the GTE predicate on the ID field. -func IDGTE(id gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldGTE(FieldID, id)) -} - -// IDLT applies the LT predicate on the ID field. -func IDLT(id gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldLT(FieldID, id)) -} - -// IDLTE applies the LTE predicate on the ID field. -func IDLTE(id gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldLTE(FieldID, id)) -} - -// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. -func CreatedAt(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldEQ(FieldCreatedAt, v)) -} - -// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. -func UpdatedAt(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldEQ(FieldUpdatedAt, v)) -} - -// LoadBalancerID applies equality check predicate on the "load_balancer_id" field. It's identical to LoadBalancerIDEQ. -func LoadBalancerID(v gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldEQ(FieldLoadBalancerID, v)) -} - -// Source applies equality check predicate on the "source" field. It's identical to SourceEQ. -func Source(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldEQ(FieldSource, v)) -} - -// CreatedAtEQ applies the EQ predicate on the "created_at" field. -func CreatedAtEQ(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldEQ(FieldCreatedAt, v)) -} - -// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. -func CreatedAtNEQ(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldNEQ(FieldCreatedAt, v)) -} - -// CreatedAtIn applies the In predicate on the "created_at" field. -func CreatedAtIn(vs ...time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldIn(FieldCreatedAt, vs...)) -} - -// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. -func CreatedAtNotIn(vs ...time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldNotIn(FieldCreatedAt, vs...)) -} - -// CreatedAtGT applies the GT predicate on the "created_at" field. -func CreatedAtGT(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldGT(FieldCreatedAt, v)) -} - -// CreatedAtGTE applies the GTE predicate on the "created_at" field. -func CreatedAtGTE(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldGTE(FieldCreatedAt, v)) -} - -// CreatedAtLT applies the LT predicate on the "created_at" field. -func CreatedAtLT(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldLT(FieldCreatedAt, v)) -} - -// CreatedAtLTE applies the LTE predicate on the "created_at" field. -func CreatedAtLTE(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldLTE(FieldCreatedAt, v)) -} - -// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. -func UpdatedAtEQ(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldEQ(FieldUpdatedAt, v)) -} - -// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. -func UpdatedAtNEQ(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldNEQ(FieldUpdatedAt, v)) -} - -// UpdatedAtIn applies the In predicate on the "updated_at" field. -func UpdatedAtIn(vs ...time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldIn(FieldUpdatedAt, vs...)) -} - -// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. -func UpdatedAtNotIn(vs ...time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldNotIn(FieldUpdatedAt, vs...)) -} - -// UpdatedAtGT applies the GT predicate on the "updated_at" field. -func UpdatedAtGT(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldGT(FieldUpdatedAt, v)) -} - -// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. -func UpdatedAtGTE(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldGTE(FieldUpdatedAt, v)) -} - -// UpdatedAtLT applies the LT predicate on the "updated_at" field. -func UpdatedAtLT(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldLT(FieldUpdatedAt, v)) -} - -// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. -func UpdatedAtLTE(v time.Time) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldLTE(FieldUpdatedAt, v)) -} - -// LoadBalancerIDEQ applies the EQ predicate on the "load_balancer_id" field. -func LoadBalancerIDEQ(v gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldEQ(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDNEQ applies the NEQ predicate on the "load_balancer_id" field. -func LoadBalancerIDNEQ(v gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldNEQ(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDIn applies the In predicate on the "load_balancer_id" field. -func LoadBalancerIDIn(vs ...gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldIn(FieldLoadBalancerID, vs...)) -} - -// LoadBalancerIDNotIn applies the NotIn predicate on the "load_balancer_id" field. -func LoadBalancerIDNotIn(vs ...gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldNotIn(FieldLoadBalancerID, vs...)) -} - -// LoadBalancerIDGT applies the GT predicate on the "load_balancer_id" field. -func LoadBalancerIDGT(v gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldGT(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDGTE applies the GTE predicate on the "load_balancer_id" field. -func LoadBalancerIDGTE(v gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldGTE(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDLT applies the LT predicate on the "load_balancer_id" field. -func LoadBalancerIDLT(v gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldLT(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDLTE applies the LTE predicate on the "load_balancer_id" field. -func LoadBalancerIDLTE(v gidx.PrefixedID) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldLTE(FieldLoadBalancerID, v)) -} - -// LoadBalancerIDContains applies the Contains predicate on the "load_balancer_id" field. -func LoadBalancerIDContains(v gidx.PrefixedID) predicate.LoadBalancerStatus { - vc := string(v) - return predicate.LoadBalancerStatus(sql.FieldContains(FieldLoadBalancerID, vc)) -} - -// LoadBalancerIDHasPrefix applies the HasPrefix predicate on the "load_balancer_id" field. -func LoadBalancerIDHasPrefix(v gidx.PrefixedID) predicate.LoadBalancerStatus { - vc := string(v) - return predicate.LoadBalancerStatus(sql.FieldHasPrefix(FieldLoadBalancerID, vc)) -} - -// LoadBalancerIDHasSuffix applies the HasSuffix predicate on the "load_balancer_id" field. -func LoadBalancerIDHasSuffix(v gidx.PrefixedID) predicate.LoadBalancerStatus { - vc := string(v) - return predicate.LoadBalancerStatus(sql.FieldHasSuffix(FieldLoadBalancerID, vc)) -} - -// LoadBalancerIDEqualFold applies the EqualFold predicate on the "load_balancer_id" field. -func LoadBalancerIDEqualFold(v gidx.PrefixedID) predicate.LoadBalancerStatus { - vc := string(v) - return predicate.LoadBalancerStatus(sql.FieldEqualFold(FieldLoadBalancerID, vc)) -} - -// LoadBalancerIDContainsFold applies the ContainsFold predicate on the "load_balancer_id" field. -func LoadBalancerIDContainsFold(v gidx.PrefixedID) predicate.LoadBalancerStatus { - vc := string(v) - return predicate.LoadBalancerStatus(sql.FieldContainsFold(FieldLoadBalancerID, vc)) -} - -// SourceEQ applies the EQ predicate on the "source" field. -func SourceEQ(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldEQ(FieldSource, v)) -} - -// SourceNEQ applies the NEQ predicate on the "source" field. -func SourceNEQ(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldNEQ(FieldSource, v)) -} - -// SourceIn applies the In predicate on the "source" field. -func SourceIn(vs ...string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldIn(FieldSource, vs...)) -} - -// SourceNotIn applies the NotIn predicate on the "source" field. -func SourceNotIn(vs ...string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldNotIn(FieldSource, vs...)) -} - -// SourceGT applies the GT predicate on the "source" field. -func SourceGT(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldGT(FieldSource, v)) -} - -// SourceGTE applies the GTE predicate on the "source" field. -func SourceGTE(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldGTE(FieldSource, v)) -} - -// SourceLT applies the LT predicate on the "source" field. -func SourceLT(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldLT(FieldSource, v)) -} - -// SourceLTE applies the LTE predicate on the "source" field. -func SourceLTE(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldLTE(FieldSource, v)) -} - -// SourceContains applies the Contains predicate on the "source" field. -func SourceContains(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldContains(FieldSource, v)) -} - -// SourceHasPrefix applies the HasPrefix predicate on the "source" field. -func SourceHasPrefix(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldHasPrefix(FieldSource, v)) -} - -// SourceHasSuffix applies the HasSuffix predicate on the "source" field. -func SourceHasSuffix(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldHasSuffix(FieldSource, v)) -} - -// SourceEqualFold applies the EqualFold predicate on the "source" field. -func SourceEqualFold(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldEqualFold(FieldSource, v)) -} - -// SourceContainsFold applies the ContainsFold predicate on the "source" field. -func SourceContainsFold(v string) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(sql.FieldContainsFold(FieldSource, v)) -} - -// HasLoadBalancer applies the HasEdge predicate on the "load_balancer" edge. -func HasLoadBalancer() predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(func(s *sql.Selector) { - step := sqlgraph.NewStep( - sqlgraph.From(Table, FieldID), - sqlgraph.Edge(sqlgraph.M2O, false, LoadBalancerTable, LoadBalancerColumn), - ) - sqlgraph.HasNeighbors(s, step) - }) -} - -// HasLoadBalancerWith applies the HasEdge predicate on the "load_balancer" edge with a given conditions (other predicates). -func HasLoadBalancerWith(preds ...predicate.LoadBalancer) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(func(s *sql.Selector) { - step := newLoadBalancerStep() - sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { - for _, p := range preds { - p(s) - } - }) - }) -} - -// And groups predicates with the AND operator between them. -func And(predicates ...predicate.LoadBalancerStatus) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }) -} - -// Or groups predicates with the OR operator between them. -func Or(predicates ...predicate.LoadBalancerStatus) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) - } - s.Where(s1.P()) - }) -} - -// Not applies the not operator on the given predicate. -func Not(p predicate.LoadBalancerStatus) predicate.LoadBalancerStatus { - return predicate.LoadBalancerStatus(func(s *sql.Selector) { - p(s.Not()) - }) -} diff --git a/internal/ent/generated/loadbalancerstatus_create.go b/internal/ent/generated/loadbalancerstatus_create.go deleted file mode 100644 index cf8ae55ec..000000000 --- a/internal/ent/generated/loadbalancerstatus_create.go +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package generated - -import ( - "context" - "errors" - "fmt" - "time" - - "entgo.io/ent/dialect/sql/sqlgraph" - "entgo.io/ent/schema/field" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" - "go.infratographer.com/x/gidx" -) - -// LoadBalancerStatusCreate is the builder for creating a LoadBalancerStatus entity. -type LoadBalancerStatusCreate struct { - config - mutation *LoadBalancerStatusMutation - hooks []Hook -} - -// SetCreatedAt sets the "created_at" field. -func (lbsc *LoadBalancerStatusCreate) SetCreatedAt(t time.Time) *LoadBalancerStatusCreate { - lbsc.mutation.SetCreatedAt(t) - return lbsc -} - -// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. -func (lbsc *LoadBalancerStatusCreate) SetNillableCreatedAt(t *time.Time) *LoadBalancerStatusCreate { - if t != nil { - lbsc.SetCreatedAt(*t) - } - return lbsc -} - -// SetUpdatedAt sets the "updated_at" field. -func (lbsc *LoadBalancerStatusCreate) SetUpdatedAt(t time.Time) *LoadBalancerStatusCreate { - lbsc.mutation.SetUpdatedAt(t) - return lbsc -} - -// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. -func (lbsc *LoadBalancerStatusCreate) SetNillableUpdatedAt(t *time.Time) *LoadBalancerStatusCreate { - if t != nil { - lbsc.SetUpdatedAt(*t) - } - return lbsc -} - -// SetLoadBalancerID sets the "load_balancer_id" field. -func (lbsc *LoadBalancerStatusCreate) SetLoadBalancerID(gi gidx.PrefixedID) *LoadBalancerStatusCreate { - lbsc.mutation.SetLoadBalancerID(gi) - return lbsc -} - -// SetSource sets the "source" field. -func (lbsc *LoadBalancerStatusCreate) SetSource(s string) *LoadBalancerStatusCreate { - lbsc.mutation.SetSource(s) - return lbsc -} - -// SetID sets the "id" field. -func (lbsc *LoadBalancerStatusCreate) SetID(gi gidx.PrefixedID) *LoadBalancerStatusCreate { - lbsc.mutation.SetID(gi) - return lbsc -} - -// SetNillableID sets the "id" field if the given value is not nil. -func (lbsc *LoadBalancerStatusCreate) SetNillableID(gi *gidx.PrefixedID) *LoadBalancerStatusCreate { - if gi != nil { - lbsc.SetID(*gi) - } - return lbsc -} - -// SetLoadBalancer sets the "load_balancer" edge to the LoadBalancer entity. -func (lbsc *LoadBalancerStatusCreate) SetLoadBalancer(l *LoadBalancer) *LoadBalancerStatusCreate { - return lbsc.SetLoadBalancerID(l.ID) -} - -// Mutation returns the LoadBalancerStatusMutation object of the builder. -func (lbsc *LoadBalancerStatusCreate) Mutation() *LoadBalancerStatusMutation { - return lbsc.mutation -} - -// Save creates the LoadBalancerStatus in the database. -func (lbsc *LoadBalancerStatusCreate) Save(ctx context.Context) (*LoadBalancerStatus, error) { - lbsc.defaults() - return withHooks(ctx, lbsc.sqlSave, lbsc.mutation, lbsc.hooks) -} - -// SaveX calls Save and panics if Save returns an error. -func (lbsc *LoadBalancerStatusCreate) SaveX(ctx context.Context) *LoadBalancerStatus { - v, err := lbsc.Save(ctx) - if err != nil { - panic(err) - } - return v -} - -// Exec executes the query. -func (lbsc *LoadBalancerStatusCreate) Exec(ctx context.Context) error { - _, err := lbsc.Save(ctx) - return err -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbsc *LoadBalancerStatusCreate) ExecX(ctx context.Context) { - if err := lbsc.Exec(ctx); err != nil { - panic(err) - } -} - -// defaults sets the default values of the builder before save. -func (lbsc *LoadBalancerStatusCreate) defaults() { - if _, ok := lbsc.mutation.CreatedAt(); !ok { - v := loadbalancerstatus.DefaultCreatedAt() - lbsc.mutation.SetCreatedAt(v) - } - if _, ok := lbsc.mutation.UpdatedAt(); !ok { - v := loadbalancerstatus.DefaultUpdatedAt() - lbsc.mutation.SetUpdatedAt(v) - } - if _, ok := lbsc.mutation.ID(); !ok { - v := loadbalancerstatus.DefaultID() - lbsc.mutation.SetID(v) - } -} - -// check runs all checks and user-defined validators on the builder. -func (lbsc *LoadBalancerStatusCreate) check() error { - if _, ok := lbsc.mutation.CreatedAt(); !ok { - return &ValidationError{Name: "created_at", err: errors.New(`generated: missing required field "LoadBalancerStatus.created_at"`)} - } - if _, ok := lbsc.mutation.UpdatedAt(); !ok { - return &ValidationError{Name: "updated_at", err: errors.New(`generated: missing required field "LoadBalancerStatus.updated_at"`)} - } - if _, ok := lbsc.mutation.LoadBalancerID(); !ok { - return &ValidationError{Name: "load_balancer_id", err: errors.New(`generated: missing required field "LoadBalancerStatus.load_balancer_id"`)} - } - if _, ok := lbsc.mutation.Source(); !ok { - return &ValidationError{Name: "source", err: errors.New(`generated: missing required field "LoadBalancerStatus.source"`)} - } - if v, ok := lbsc.mutation.Source(); ok { - if err := loadbalancerstatus.SourceValidator(v); err != nil { - return &ValidationError{Name: "source", err: fmt.Errorf(`generated: validator failed for field "LoadBalancerStatus.source": %w`, err)} - } - } - if _, ok := lbsc.mutation.LoadBalancerID(); !ok { - return &ValidationError{Name: "load_balancer", err: errors.New(`generated: missing required edge "LoadBalancerStatus.load_balancer"`)} - } - return nil -} - -func (lbsc *LoadBalancerStatusCreate) sqlSave(ctx context.Context) (*LoadBalancerStatus, error) { - if err := lbsc.check(); err != nil { - return nil, err - } - _node, _spec := lbsc.createSpec() - if err := sqlgraph.CreateNode(ctx, lbsc.driver, _spec); err != nil { - if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{msg: err.Error(), wrap: err} - } - return nil, err - } - if _spec.ID.Value != nil { - if id, ok := _spec.ID.Value.(*gidx.PrefixedID); ok { - _node.ID = *id - } else if err := _node.ID.Scan(_spec.ID.Value); err != nil { - return nil, err - } - } - lbsc.mutation.id = &_node.ID - lbsc.mutation.done = true - return _node, nil -} - -func (lbsc *LoadBalancerStatusCreate) createSpec() (*LoadBalancerStatus, *sqlgraph.CreateSpec) { - var ( - _node = &LoadBalancerStatus{config: lbsc.config} - _spec = sqlgraph.NewCreateSpec(loadbalancerstatus.Table, sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString)) - ) - if id, ok := lbsc.mutation.ID(); ok { - _node.ID = id - _spec.ID.Value = &id - } - if value, ok := lbsc.mutation.CreatedAt(); ok { - _spec.SetField(loadbalancerstatus.FieldCreatedAt, field.TypeTime, value) - _node.CreatedAt = value - } - if value, ok := lbsc.mutation.UpdatedAt(); ok { - _spec.SetField(loadbalancerstatus.FieldUpdatedAt, field.TypeTime, value) - _node.UpdatedAt = value - } - if value, ok := lbsc.mutation.Source(); ok { - _spec.SetField(loadbalancerstatus.FieldSource, field.TypeString, value) - _node.Source = value - } - if nodes := lbsc.mutation.LoadBalancerIDs(); len(nodes) > 0 { - edge := &sqlgraph.EdgeSpec{ - Rel: sqlgraph.M2O, - Inverse: false, - Table: loadbalancerstatus.LoadBalancerTable, - Columns: []string{loadbalancerstatus.LoadBalancerColumn}, - Bidi: false, - Target: &sqlgraph.EdgeTarget{ - IDSpec: sqlgraph.NewFieldSpec(loadbalancer.FieldID, field.TypeString), - }, - } - for _, k := range nodes { - edge.Target.Nodes = append(edge.Target.Nodes, k) - } - _node.LoadBalancerID = nodes[0] - _spec.Edges = append(_spec.Edges, edge) - } - return _node, _spec -} - -// LoadBalancerStatusCreateBulk is the builder for creating many LoadBalancerStatus entities in bulk. -type LoadBalancerStatusCreateBulk struct { - config - builders []*LoadBalancerStatusCreate -} - -// Save creates the LoadBalancerStatus entities in the database. -func (lbscb *LoadBalancerStatusCreateBulk) Save(ctx context.Context) ([]*LoadBalancerStatus, error) { - specs := make([]*sqlgraph.CreateSpec, len(lbscb.builders)) - nodes := make([]*LoadBalancerStatus, len(lbscb.builders)) - mutators := make([]Mutator, len(lbscb.builders)) - for i := range lbscb.builders { - func(i int, root context.Context) { - builder := lbscb.builders[i] - builder.defaults() - var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { - mutation, ok := m.(*LoadBalancerStatusMutation) - if !ok { - return nil, fmt.Errorf("unexpected mutation type %T", m) - } - if err := builder.check(); err != nil { - return nil, err - } - builder.mutation = mutation - var err error - nodes[i], specs[i] = builder.createSpec() - if i < len(mutators)-1 { - _, err = mutators[i+1].Mutate(root, lbscb.builders[i+1].mutation) - } else { - spec := &sqlgraph.BatchCreateSpec{Nodes: specs} - // Invoke the actual operation on the latest mutation in the chain. - if err = sqlgraph.BatchCreate(ctx, lbscb.driver, spec); err != nil { - if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{msg: err.Error(), wrap: err} - } - } - } - if err != nil { - return nil, err - } - mutation.id = &nodes[i].ID - mutation.done = true - return nodes[i], nil - }) - for i := len(builder.hooks) - 1; i >= 0; i-- { - mut = builder.hooks[i](mut) - } - mutators[i] = mut - }(i, ctx) - } - if len(mutators) > 0 { - if _, err := mutators[0].Mutate(ctx, lbscb.builders[0].mutation); err != nil { - return nil, err - } - } - return nodes, nil -} - -// SaveX is like Save, but panics if an error occurs. -func (lbscb *LoadBalancerStatusCreateBulk) SaveX(ctx context.Context) []*LoadBalancerStatus { - v, err := lbscb.Save(ctx) - if err != nil { - panic(err) - } - return v -} - -// Exec executes the query. -func (lbscb *LoadBalancerStatusCreateBulk) Exec(ctx context.Context) error { - _, err := lbscb.Save(ctx) - return err -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbscb *LoadBalancerStatusCreateBulk) ExecX(ctx context.Context) { - if err := lbscb.Exec(ctx); err != nil { - panic(err) - } -} diff --git a/internal/ent/generated/loadbalancerstatus_delete.go b/internal/ent/generated/loadbalancerstatus_delete.go deleted file mode 100644 index 293c0fcd2..000000000 --- a/internal/ent/generated/loadbalancerstatus_delete.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package generated - -import ( - "context" - - "entgo.io/ent/dialect/sql" - "entgo.io/ent/dialect/sql/sqlgraph" - "entgo.io/ent/schema/field" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" - "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" -) - -// LoadBalancerStatusDelete is the builder for deleting a LoadBalancerStatus entity. -type LoadBalancerStatusDelete struct { - config - hooks []Hook - mutation *LoadBalancerStatusMutation -} - -// Where appends a list predicates to the LoadBalancerStatusDelete builder. -func (lbsd *LoadBalancerStatusDelete) Where(ps ...predicate.LoadBalancerStatus) *LoadBalancerStatusDelete { - lbsd.mutation.Where(ps...) - return lbsd -} - -// Exec executes the deletion query and returns how many vertices were deleted. -func (lbsd *LoadBalancerStatusDelete) Exec(ctx context.Context) (int, error) { - return withHooks(ctx, lbsd.sqlExec, lbsd.mutation, lbsd.hooks) -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbsd *LoadBalancerStatusDelete) ExecX(ctx context.Context) int { - n, err := lbsd.Exec(ctx) - if err != nil { - panic(err) - } - return n -} - -func (lbsd *LoadBalancerStatusDelete) sqlExec(ctx context.Context) (int, error) { - _spec := sqlgraph.NewDeleteSpec(loadbalancerstatus.Table, sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString)) - if ps := lbsd.mutation.predicates; len(ps) > 0 { - _spec.Predicate = func(selector *sql.Selector) { - for i := range ps { - ps[i](selector) - } - } - } - affected, err := sqlgraph.DeleteNodes(ctx, lbsd.driver, _spec) - if err != nil && sqlgraph.IsConstraintError(err) { - err = &ConstraintError{msg: err.Error(), wrap: err} - } - lbsd.mutation.done = true - return affected, err -} - -// LoadBalancerStatusDeleteOne is the builder for deleting a single LoadBalancerStatus entity. -type LoadBalancerStatusDeleteOne struct { - lbsd *LoadBalancerStatusDelete -} - -// Where appends a list predicates to the LoadBalancerStatusDelete builder. -func (lbsdo *LoadBalancerStatusDeleteOne) Where(ps ...predicate.LoadBalancerStatus) *LoadBalancerStatusDeleteOne { - lbsdo.lbsd.mutation.Where(ps...) - return lbsdo -} - -// Exec executes the deletion query. -func (lbsdo *LoadBalancerStatusDeleteOne) Exec(ctx context.Context) error { - n, err := lbsdo.lbsd.Exec(ctx) - switch { - case err != nil: - return err - case n == 0: - return &NotFoundError{loadbalancerstatus.Label} - default: - return nil - } -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbsdo *LoadBalancerStatusDeleteOne) ExecX(ctx context.Context) { - if err := lbsdo.Exec(ctx); err != nil { - panic(err) - } -} diff --git a/internal/ent/generated/loadbalancerstatus_query.go b/internal/ent/generated/loadbalancerstatus_query.go deleted file mode 100644 index 3371e41a2..000000000 --- a/internal/ent/generated/loadbalancerstatus_query.go +++ /dev/null @@ -1,623 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package generated - -import ( - "context" - "fmt" - "math" - - "entgo.io/ent/dialect/sql" - "entgo.io/ent/dialect/sql/sqlgraph" - "entgo.io/ent/schema/field" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" - "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" - "go.infratographer.com/x/gidx" -) - -// LoadBalancerStatusQuery is the builder for querying LoadBalancerStatus entities. -type LoadBalancerStatusQuery struct { - config - ctx *QueryContext - order []loadbalancerstatus.OrderOption - inters []Interceptor - predicates []predicate.LoadBalancerStatus - withLoadBalancer *LoadBalancerQuery - modifiers []func(*sql.Selector) - loadTotal []func(context.Context, []*LoadBalancerStatus) error - // intermediate query (i.e. traversal path). - sql *sql.Selector - path func(context.Context) (*sql.Selector, error) -} - -// Where adds a new predicate for the LoadBalancerStatusQuery builder. -func (lbsq *LoadBalancerStatusQuery) Where(ps ...predicate.LoadBalancerStatus) *LoadBalancerStatusQuery { - lbsq.predicates = append(lbsq.predicates, ps...) - return lbsq -} - -// Limit the number of records to be returned by this query. -func (lbsq *LoadBalancerStatusQuery) Limit(limit int) *LoadBalancerStatusQuery { - lbsq.ctx.Limit = &limit - return lbsq -} - -// Offset to start from. -func (lbsq *LoadBalancerStatusQuery) Offset(offset int) *LoadBalancerStatusQuery { - lbsq.ctx.Offset = &offset - return lbsq -} - -// Unique configures the query builder to filter duplicate records on query. -// By default, unique is set to true, and can be disabled using this method. -func (lbsq *LoadBalancerStatusQuery) Unique(unique bool) *LoadBalancerStatusQuery { - lbsq.ctx.Unique = &unique - return lbsq -} - -// Order specifies how the records should be ordered. -func (lbsq *LoadBalancerStatusQuery) Order(o ...loadbalancerstatus.OrderOption) *LoadBalancerStatusQuery { - lbsq.order = append(lbsq.order, o...) - return lbsq -} - -// QueryLoadBalancer chains the current query on the "load_balancer" edge. -func (lbsq *LoadBalancerStatusQuery) QueryLoadBalancer() *LoadBalancerQuery { - query := (&LoadBalancerClient{config: lbsq.config}).Query() - query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { - if err := lbsq.prepareQuery(ctx); err != nil { - return nil, err - } - selector := lbsq.sqlQuery(ctx) - if err := selector.Err(); err != nil { - return nil, err - } - step := sqlgraph.NewStep( - sqlgraph.From(loadbalancerstatus.Table, loadbalancerstatus.FieldID, selector), - sqlgraph.To(loadbalancer.Table, loadbalancer.FieldID), - sqlgraph.Edge(sqlgraph.M2O, false, loadbalancerstatus.LoadBalancerTable, loadbalancerstatus.LoadBalancerColumn), - ) - fromU = sqlgraph.SetNeighbors(lbsq.driver.Dialect(), step) - return fromU, nil - } - return query -} - -// First returns the first LoadBalancerStatus entity from the query. -// Returns a *NotFoundError when no LoadBalancerStatus was found. -func (lbsq *LoadBalancerStatusQuery) First(ctx context.Context) (*LoadBalancerStatus, error) { - nodes, err := lbsq.Limit(1).All(setContextOp(ctx, lbsq.ctx, "First")) - if err != nil { - return nil, err - } - if len(nodes) == 0 { - return nil, &NotFoundError{loadbalancerstatus.Label} - } - return nodes[0], nil -} - -// FirstX is like First, but panics if an error occurs. -func (lbsq *LoadBalancerStatusQuery) FirstX(ctx context.Context) *LoadBalancerStatus { - node, err := lbsq.First(ctx) - if err != nil && !IsNotFound(err) { - panic(err) - } - return node -} - -// FirstID returns the first LoadBalancerStatus ID from the query. -// Returns a *NotFoundError when no LoadBalancerStatus ID was found. -func (lbsq *LoadBalancerStatusQuery) FirstID(ctx context.Context) (id gidx.PrefixedID, err error) { - var ids []gidx.PrefixedID - if ids, err = lbsq.Limit(1).IDs(setContextOp(ctx, lbsq.ctx, "FirstID")); err != nil { - return - } - if len(ids) == 0 { - err = &NotFoundError{loadbalancerstatus.Label} - return - } - return ids[0], nil -} - -// FirstIDX is like FirstID, but panics if an error occurs. -func (lbsq *LoadBalancerStatusQuery) FirstIDX(ctx context.Context) gidx.PrefixedID { - id, err := lbsq.FirstID(ctx) - if err != nil && !IsNotFound(err) { - panic(err) - } - return id -} - -// Only returns a single LoadBalancerStatus entity found by the query, ensuring it only returns one. -// Returns a *NotSingularError when more than one LoadBalancerStatus entity is found. -// Returns a *NotFoundError when no LoadBalancerStatus entities are found. -func (lbsq *LoadBalancerStatusQuery) Only(ctx context.Context) (*LoadBalancerStatus, error) { - nodes, err := lbsq.Limit(2).All(setContextOp(ctx, lbsq.ctx, "Only")) - if err != nil { - return nil, err - } - switch len(nodes) { - case 1: - return nodes[0], nil - case 0: - return nil, &NotFoundError{loadbalancerstatus.Label} - default: - return nil, &NotSingularError{loadbalancerstatus.Label} - } -} - -// OnlyX is like Only, but panics if an error occurs. -func (lbsq *LoadBalancerStatusQuery) OnlyX(ctx context.Context) *LoadBalancerStatus { - node, err := lbsq.Only(ctx) - if err != nil { - panic(err) - } - return node -} - -// OnlyID is like Only, but returns the only LoadBalancerStatus ID in the query. -// Returns a *NotSingularError when more than one LoadBalancerStatus ID is found. -// Returns a *NotFoundError when no entities are found. -func (lbsq *LoadBalancerStatusQuery) OnlyID(ctx context.Context) (id gidx.PrefixedID, err error) { - var ids []gidx.PrefixedID - if ids, err = lbsq.Limit(2).IDs(setContextOp(ctx, lbsq.ctx, "OnlyID")); err != nil { - return - } - switch len(ids) { - case 1: - id = ids[0] - case 0: - err = &NotFoundError{loadbalancerstatus.Label} - default: - err = &NotSingularError{loadbalancerstatus.Label} - } - return -} - -// OnlyIDX is like OnlyID, but panics if an error occurs. -func (lbsq *LoadBalancerStatusQuery) OnlyIDX(ctx context.Context) gidx.PrefixedID { - id, err := lbsq.OnlyID(ctx) - if err != nil { - panic(err) - } - return id -} - -// All executes the query and returns a list of LoadBalancerStatusSlice. -func (lbsq *LoadBalancerStatusQuery) All(ctx context.Context) ([]*LoadBalancerStatus, error) { - ctx = setContextOp(ctx, lbsq.ctx, "All") - if err := lbsq.prepareQuery(ctx); err != nil { - return nil, err - } - qr := querierAll[[]*LoadBalancerStatus, *LoadBalancerStatusQuery]() - return withInterceptors[[]*LoadBalancerStatus](ctx, lbsq, qr, lbsq.inters) -} - -// AllX is like All, but panics if an error occurs. -func (lbsq *LoadBalancerStatusQuery) AllX(ctx context.Context) []*LoadBalancerStatus { - nodes, err := lbsq.All(ctx) - if err != nil { - panic(err) - } - return nodes -} - -// IDs executes the query and returns a list of LoadBalancerStatus IDs. -func (lbsq *LoadBalancerStatusQuery) IDs(ctx context.Context) (ids []gidx.PrefixedID, err error) { - if lbsq.ctx.Unique == nil && lbsq.path != nil { - lbsq.Unique(true) - } - ctx = setContextOp(ctx, lbsq.ctx, "IDs") - if err = lbsq.Select(loadbalancerstatus.FieldID).Scan(ctx, &ids); err != nil { - return nil, err - } - return ids, nil -} - -// IDsX is like IDs, but panics if an error occurs. -func (lbsq *LoadBalancerStatusQuery) IDsX(ctx context.Context) []gidx.PrefixedID { - ids, err := lbsq.IDs(ctx) - if err != nil { - panic(err) - } - return ids -} - -// Count returns the count of the given query. -func (lbsq *LoadBalancerStatusQuery) Count(ctx context.Context) (int, error) { - ctx = setContextOp(ctx, lbsq.ctx, "Count") - if err := lbsq.prepareQuery(ctx); err != nil { - return 0, err - } - return withInterceptors[int](ctx, lbsq, querierCount[*LoadBalancerStatusQuery](), lbsq.inters) -} - -// CountX is like Count, but panics if an error occurs. -func (lbsq *LoadBalancerStatusQuery) CountX(ctx context.Context) int { - count, err := lbsq.Count(ctx) - if err != nil { - panic(err) - } - return count -} - -// Exist returns true if the query has elements in the graph. -func (lbsq *LoadBalancerStatusQuery) Exist(ctx context.Context) (bool, error) { - ctx = setContextOp(ctx, lbsq.ctx, "Exist") - switch _, err := lbsq.FirstID(ctx); { - case IsNotFound(err): - return false, nil - case err != nil: - return false, fmt.Errorf("generated: check existence: %w", err) - default: - return true, nil - } -} - -// ExistX is like Exist, but panics if an error occurs. -func (lbsq *LoadBalancerStatusQuery) ExistX(ctx context.Context) bool { - exist, err := lbsq.Exist(ctx) - if err != nil { - panic(err) - } - return exist -} - -// Clone returns a duplicate of the LoadBalancerStatusQuery builder, including all associated steps. It can be -// used to prepare common query builders and use them differently after the clone is made. -func (lbsq *LoadBalancerStatusQuery) Clone() *LoadBalancerStatusQuery { - if lbsq == nil { - return nil - } - return &LoadBalancerStatusQuery{ - config: lbsq.config, - ctx: lbsq.ctx.Clone(), - order: append([]loadbalancerstatus.OrderOption{}, lbsq.order...), - inters: append([]Interceptor{}, lbsq.inters...), - predicates: append([]predicate.LoadBalancerStatus{}, lbsq.predicates...), - withLoadBalancer: lbsq.withLoadBalancer.Clone(), - // clone intermediate query. - sql: lbsq.sql.Clone(), - path: lbsq.path, - } -} - -// WithLoadBalancer tells the query-builder to eager-load the nodes that are connected to -// the "load_balancer" edge. The optional arguments are used to configure the query builder of the edge. -func (lbsq *LoadBalancerStatusQuery) WithLoadBalancer(opts ...func(*LoadBalancerQuery)) *LoadBalancerStatusQuery { - query := (&LoadBalancerClient{config: lbsq.config}).Query() - for _, opt := range opts { - opt(query) - } - lbsq.withLoadBalancer = query - return lbsq -} - -// GroupBy is used to group vertices by one or more fields/columns. -// It is often used with aggregate functions, like: count, max, mean, min, sum. -// -// Example: -// -// var v []struct { -// CreatedAt time.Time `json:"created_at,omitempty"` -// Count int `json:"count,omitempty"` -// } -// -// client.LoadBalancerStatus.Query(). -// GroupBy(loadbalancerstatus.FieldCreatedAt). -// Aggregate(generated.Count()). -// Scan(ctx, &v) -func (lbsq *LoadBalancerStatusQuery) GroupBy(field string, fields ...string) *LoadBalancerStatusGroupBy { - lbsq.ctx.Fields = append([]string{field}, fields...) - grbuild := &LoadBalancerStatusGroupBy{build: lbsq} - grbuild.flds = &lbsq.ctx.Fields - grbuild.label = loadbalancerstatus.Label - grbuild.scan = grbuild.Scan - return grbuild -} - -// Select allows the selection one or more fields/columns for the given query, -// instead of selecting all fields in the entity. -// -// Example: -// -// var v []struct { -// CreatedAt time.Time `json:"created_at,omitempty"` -// } -// -// client.LoadBalancerStatus.Query(). -// Select(loadbalancerstatus.FieldCreatedAt). -// Scan(ctx, &v) -func (lbsq *LoadBalancerStatusQuery) Select(fields ...string) *LoadBalancerStatusSelect { - lbsq.ctx.Fields = append(lbsq.ctx.Fields, fields...) - sbuild := &LoadBalancerStatusSelect{LoadBalancerStatusQuery: lbsq} - sbuild.label = loadbalancerstatus.Label - sbuild.flds, sbuild.scan = &lbsq.ctx.Fields, sbuild.Scan - return sbuild -} - -// Aggregate returns a LoadBalancerStatusSelect configured with the given aggregations. -func (lbsq *LoadBalancerStatusQuery) Aggregate(fns ...AggregateFunc) *LoadBalancerStatusSelect { - return lbsq.Select().Aggregate(fns...) -} - -func (lbsq *LoadBalancerStatusQuery) prepareQuery(ctx context.Context) error { - for _, inter := range lbsq.inters { - if inter == nil { - return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") - } - if trv, ok := inter.(Traverser); ok { - if err := trv.Traverse(ctx, lbsq); err != nil { - return err - } - } - } - for _, f := range lbsq.ctx.Fields { - if !loadbalancerstatus.ValidColumn(f) { - return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} - } - } - if lbsq.path != nil { - prev, err := lbsq.path(ctx) - if err != nil { - return err - } - lbsq.sql = prev - } - return nil -} - -func (lbsq *LoadBalancerStatusQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*LoadBalancerStatus, error) { - var ( - nodes = []*LoadBalancerStatus{} - _spec = lbsq.querySpec() - loadedTypes = [1]bool{ - lbsq.withLoadBalancer != nil, - } - ) - _spec.ScanValues = func(columns []string) ([]any, error) { - return (*LoadBalancerStatus).scanValues(nil, columns) - } - _spec.Assign = func(columns []string, values []any) error { - node := &LoadBalancerStatus{config: lbsq.config} - nodes = append(nodes, node) - node.Edges.loadedTypes = loadedTypes - return node.assignValues(columns, values) - } - if len(lbsq.modifiers) > 0 { - _spec.Modifiers = lbsq.modifiers - } - for i := range hooks { - hooks[i](ctx, _spec) - } - if err := sqlgraph.QueryNodes(ctx, lbsq.driver, _spec); err != nil { - return nil, err - } - if len(nodes) == 0 { - return nodes, nil - } - if query := lbsq.withLoadBalancer; query != nil { - if err := lbsq.loadLoadBalancer(ctx, query, nodes, nil, - func(n *LoadBalancerStatus, e *LoadBalancer) { n.Edges.LoadBalancer = e }); err != nil { - return nil, err - } - } - for i := range lbsq.loadTotal { - if err := lbsq.loadTotal[i](ctx, nodes); err != nil { - return nil, err - } - } - return nodes, nil -} - -func (lbsq *LoadBalancerStatusQuery) loadLoadBalancer(ctx context.Context, query *LoadBalancerQuery, nodes []*LoadBalancerStatus, init func(*LoadBalancerStatus), assign func(*LoadBalancerStatus, *LoadBalancer)) error { - ids := make([]gidx.PrefixedID, 0, len(nodes)) - nodeids := make(map[gidx.PrefixedID][]*LoadBalancerStatus) - for i := range nodes { - fk := nodes[i].LoadBalancerID - if _, ok := nodeids[fk]; !ok { - ids = append(ids, fk) - } - nodeids[fk] = append(nodeids[fk], nodes[i]) - } - if len(ids) == 0 { - return nil - } - query.Where(loadbalancer.IDIn(ids...)) - neighbors, err := query.All(ctx) - if err != nil { - return err - } - for _, n := range neighbors { - nodes, ok := nodeids[n.ID] - if !ok { - return fmt.Errorf(`unexpected foreign-key "load_balancer_id" returned %v`, n.ID) - } - for i := range nodes { - assign(nodes[i], n) - } - } - return nil -} - -func (lbsq *LoadBalancerStatusQuery) sqlCount(ctx context.Context) (int, error) { - _spec := lbsq.querySpec() - if len(lbsq.modifiers) > 0 { - _spec.Modifiers = lbsq.modifiers - } - _spec.Node.Columns = lbsq.ctx.Fields - if len(lbsq.ctx.Fields) > 0 { - _spec.Unique = lbsq.ctx.Unique != nil && *lbsq.ctx.Unique - } - return sqlgraph.CountNodes(ctx, lbsq.driver, _spec) -} - -func (lbsq *LoadBalancerStatusQuery) querySpec() *sqlgraph.QuerySpec { - _spec := sqlgraph.NewQuerySpec(loadbalancerstatus.Table, loadbalancerstatus.Columns, sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString)) - _spec.From = lbsq.sql - if unique := lbsq.ctx.Unique; unique != nil { - _spec.Unique = *unique - } else if lbsq.path != nil { - _spec.Unique = true - } - if fields := lbsq.ctx.Fields; len(fields) > 0 { - _spec.Node.Columns = make([]string, 0, len(fields)) - _spec.Node.Columns = append(_spec.Node.Columns, loadbalancerstatus.FieldID) - for i := range fields { - if fields[i] != loadbalancerstatus.FieldID { - _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) - } - } - if lbsq.withLoadBalancer != nil { - _spec.Node.AddColumnOnce(loadbalancerstatus.FieldLoadBalancerID) - } - } - if ps := lbsq.predicates; len(ps) > 0 { - _spec.Predicate = func(selector *sql.Selector) { - for i := range ps { - ps[i](selector) - } - } - } - if limit := lbsq.ctx.Limit; limit != nil { - _spec.Limit = *limit - } - if offset := lbsq.ctx.Offset; offset != nil { - _spec.Offset = *offset - } - if ps := lbsq.order; len(ps) > 0 { - _spec.Order = func(selector *sql.Selector) { - for i := range ps { - ps[i](selector) - } - } - } - return _spec -} - -func (lbsq *LoadBalancerStatusQuery) sqlQuery(ctx context.Context) *sql.Selector { - builder := sql.Dialect(lbsq.driver.Dialect()) - t1 := builder.Table(loadbalancerstatus.Table) - columns := lbsq.ctx.Fields - if len(columns) == 0 { - columns = loadbalancerstatus.Columns - } - selector := builder.Select(t1.Columns(columns...)...).From(t1) - if lbsq.sql != nil { - selector = lbsq.sql - selector.Select(selector.Columns(columns...)...) - } - if lbsq.ctx.Unique != nil && *lbsq.ctx.Unique { - selector.Distinct() - } - for _, p := range lbsq.predicates { - p(selector) - } - for _, p := range lbsq.order { - p(selector) - } - if offset := lbsq.ctx.Offset; offset != nil { - // limit is mandatory for offset clause. We start - // with default value, and override it below if needed. - selector.Offset(*offset).Limit(math.MaxInt32) - } - if limit := lbsq.ctx.Limit; limit != nil { - selector.Limit(*limit) - } - return selector -} - -// LoadBalancerStatusGroupBy is the group-by builder for LoadBalancerStatus entities. -type LoadBalancerStatusGroupBy struct { - selector - build *LoadBalancerStatusQuery -} - -// Aggregate adds the given aggregation functions to the group-by query. -func (lbsgb *LoadBalancerStatusGroupBy) Aggregate(fns ...AggregateFunc) *LoadBalancerStatusGroupBy { - lbsgb.fns = append(lbsgb.fns, fns...) - return lbsgb -} - -// Scan applies the selector query and scans the result into the given value. -func (lbsgb *LoadBalancerStatusGroupBy) Scan(ctx context.Context, v any) error { - ctx = setContextOp(ctx, lbsgb.build.ctx, "GroupBy") - if err := lbsgb.build.prepareQuery(ctx); err != nil { - return err - } - return scanWithInterceptors[*LoadBalancerStatusQuery, *LoadBalancerStatusGroupBy](ctx, lbsgb.build, lbsgb, lbsgb.build.inters, v) -} - -func (lbsgb *LoadBalancerStatusGroupBy) sqlScan(ctx context.Context, root *LoadBalancerStatusQuery, v any) error { - selector := root.sqlQuery(ctx).Select() - aggregation := make([]string, 0, len(lbsgb.fns)) - for _, fn := range lbsgb.fns { - aggregation = append(aggregation, fn(selector)) - } - if len(selector.SelectedColumns()) == 0 { - columns := make([]string, 0, len(*lbsgb.flds)+len(lbsgb.fns)) - for _, f := range *lbsgb.flds { - columns = append(columns, selector.C(f)) - } - columns = append(columns, aggregation...) - selector.Select(columns...) - } - selector.GroupBy(selector.Columns(*lbsgb.flds...)...) - if err := selector.Err(); err != nil { - return err - } - rows := &sql.Rows{} - query, args := selector.Query() - if err := lbsgb.build.driver.Query(ctx, query, args, rows); err != nil { - return err - } - defer rows.Close() - return sql.ScanSlice(rows, v) -} - -// LoadBalancerStatusSelect is the builder for selecting fields of LoadBalancerStatus entities. -type LoadBalancerStatusSelect struct { - *LoadBalancerStatusQuery - selector -} - -// Aggregate adds the given aggregation functions to the selector query. -func (lbss *LoadBalancerStatusSelect) Aggregate(fns ...AggregateFunc) *LoadBalancerStatusSelect { - lbss.fns = append(lbss.fns, fns...) - return lbss -} - -// Scan applies the selector query and scans the result into the given value. -func (lbss *LoadBalancerStatusSelect) Scan(ctx context.Context, v any) error { - ctx = setContextOp(ctx, lbss.ctx, "Select") - if err := lbss.prepareQuery(ctx); err != nil { - return err - } - return scanWithInterceptors[*LoadBalancerStatusQuery, *LoadBalancerStatusSelect](ctx, lbss.LoadBalancerStatusQuery, lbss, lbss.inters, v) -} - -func (lbss *LoadBalancerStatusSelect) sqlScan(ctx context.Context, root *LoadBalancerStatusQuery, v any) error { - selector := root.sqlQuery(ctx) - aggregation := make([]string, 0, len(lbss.fns)) - for _, fn := range lbss.fns { - aggregation = append(aggregation, fn(selector)) - } - switch n := len(*lbss.selector.flds); { - case n == 0 && len(aggregation) > 0: - selector.Select(aggregation...) - case n != 0 && len(aggregation) > 0: - selector.AppendSelect(aggregation...) - } - rows := &sql.Rows{} - query, args := selector.Query() - if err := lbss.driver.Query(ctx, query, args, rows); err != nil { - return err - } - defer rows.Close() - return sql.ScanSlice(rows, v) -} diff --git a/internal/ent/generated/loadbalancerstatus_update.go b/internal/ent/generated/loadbalancerstatus_update.go deleted file mode 100644 index bb597240c..000000000 --- a/internal/ent/generated/loadbalancerstatus_update.go +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. -// -// Code generated by entc, DO NOT EDIT. - -package generated - -import ( - "context" - "errors" - "fmt" - - "entgo.io/ent/dialect/sql" - "entgo.io/ent/dialect/sql/sqlgraph" - "entgo.io/ent/schema/field" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" - "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" -) - -// LoadBalancerStatusUpdate is the builder for updating LoadBalancerStatus entities. -type LoadBalancerStatusUpdate struct { - config - hooks []Hook - mutation *LoadBalancerStatusMutation -} - -// Where appends a list predicates to the LoadBalancerStatusUpdate builder. -func (lbsu *LoadBalancerStatusUpdate) Where(ps ...predicate.LoadBalancerStatus) *LoadBalancerStatusUpdate { - lbsu.mutation.Where(ps...) - return lbsu -} - -// Mutation returns the LoadBalancerStatusMutation object of the builder. -func (lbsu *LoadBalancerStatusUpdate) Mutation() *LoadBalancerStatusMutation { - return lbsu.mutation -} - -// Save executes the query and returns the number of nodes affected by the update operation. -func (lbsu *LoadBalancerStatusUpdate) Save(ctx context.Context) (int, error) { - lbsu.defaults() - return withHooks(ctx, lbsu.sqlSave, lbsu.mutation, lbsu.hooks) -} - -// SaveX is like Save, but panics if an error occurs. -func (lbsu *LoadBalancerStatusUpdate) SaveX(ctx context.Context) int { - affected, err := lbsu.Save(ctx) - if err != nil { - panic(err) - } - return affected -} - -// Exec executes the query. -func (lbsu *LoadBalancerStatusUpdate) Exec(ctx context.Context) error { - _, err := lbsu.Save(ctx) - return err -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbsu *LoadBalancerStatusUpdate) ExecX(ctx context.Context) { - if err := lbsu.Exec(ctx); err != nil { - panic(err) - } -} - -// defaults sets the default values of the builder before save. -func (lbsu *LoadBalancerStatusUpdate) defaults() { - if _, ok := lbsu.mutation.UpdatedAt(); !ok { - v := loadbalancerstatus.UpdateDefaultUpdatedAt() - lbsu.mutation.SetUpdatedAt(v) - } -} - -// check runs all checks and user-defined validators on the builder. -func (lbsu *LoadBalancerStatusUpdate) check() error { - if _, ok := lbsu.mutation.LoadBalancerID(); lbsu.mutation.LoadBalancerCleared() && !ok { - return errors.New(`generated: clearing a required unique edge "LoadBalancerStatus.load_balancer"`) - } - return nil -} - -func (lbsu *LoadBalancerStatusUpdate) sqlSave(ctx context.Context) (n int, err error) { - if err := lbsu.check(); err != nil { - return n, err - } - _spec := sqlgraph.NewUpdateSpec(loadbalancerstatus.Table, loadbalancerstatus.Columns, sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString)) - if ps := lbsu.mutation.predicates; len(ps) > 0 { - _spec.Predicate = func(selector *sql.Selector) { - for i := range ps { - ps[i](selector) - } - } - } - if value, ok := lbsu.mutation.UpdatedAt(); ok { - _spec.SetField(loadbalancerstatus.FieldUpdatedAt, field.TypeTime, value) - } - if n, err = sqlgraph.UpdateNodes(ctx, lbsu.driver, _spec); err != nil { - if _, ok := err.(*sqlgraph.NotFoundError); ok { - err = &NotFoundError{loadbalancerstatus.Label} - } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{msg: err.Error(), wrap: err} - } - return 0, err - } - lbsu.mutation.done = true - return n, nil -} - -// LoadBalancerStatusUpdateOne is the builder for updating a single LoadBalancerStatus entity. -type LoadBalancerStatusUpdateOne struct { - config - fields []string - hooks []Hook - mutation *LoadBalancerStatusMutation -} - -// Mutation returns the LoadBalancerStatusMutation object of the builder. -func (lbsuo *LoadBalancerStatusUpdateOne) Mutation() *LoadBalancerStatusMutation { - return lbsuo.mutation -} - -// Where appends a list predicates to the LoadBalancerStatusUpdate builder. -func (lbsuo *LoadBalancerStatusUpdateOne) Where(ps ...predicate.LoadBalancerStatus) *LoadBalancerStatusUpdateOne { - lbsuo.mutation.Where(ps...) - return lbsuo -} - -// Select allows selecting one or more fields (columns) of the returned entity. -// The default is selecting all fields defined in the entity schema. -func (lbsuo *LoadBalancerStatusUpdateOne) Select(field string, fields ...string) *LoadBalancerStatusUpdateOne { - lbsuo.fields = append([]string{field}, fields...) - return lbsuo -} - -// Save executes the query and returns the updated LoadBalancerStatus entity. -func (lbsuo *LoadBalancerStatusUpdateOne) Save(ctx context.Context) (*LoadBalancerStatus, error) { - lbsuo.defaults() - return withHooks(ctx, lbsuo.sqlSave, lbsuo.mutation, lbsuo.hooks) -} - -// SaveX is like Save, but panics if an error occurs. -func (lbsuo *LoadBalancerStatusUpdateOne) SaveX(ctx context.Context) *LoadBalancerStatus { - node, err := lbsuo.Save(ctx) - if err != nil { - panic(err) - } - return node -} - -// Exec executes the query on the entity. -func (lbsuo *LoadBalancerStatusUpdateOne) Exec(ctx context.Context) error { - _, err := lbsuo.Save(ctx) - return err -} - -// ExecX is like Exec, but panics if an error occurs. -func (lbsuo *LoadBalancerStatusUpdateOne) ExecX(ctx context.Context) { - if err := lbsuo.Exec(ctx); err != nil { - panic(err) - } -} - -// defaults sets the default values of the builder before save. -func (lbsuo *LoadBalancerStatusUpdateOne) defaults() { - if _, ok := lbsuo.mutation.UpdatedAt(); !ok { - v := loadbalancerstatus.UpdateDefaultUpdatedAt() - lbsuo.mutation.SetUpdatedAt(v) - } -} - -// check runs all checks and user-defined validators on the builder. -func (lbsuo *LoadBalancerStatusUpdateOne) check() error { - if _, ok := lbsuo.mutation.LoadBalancerID(); lbsuo.mutation.LoadBalancerCleared() && !ok { - return errors.New(`generated: clearing a required unique edge "LoadBalancerStatus.load_balancer"`) - } - return nil -} - -func (lbsuo *LoadBalancerStatusUpdateOne) sqlSave(ctx context.Context) (_node *LoadBalancerStatus, err error) { - if err := lbsuo.check(); err != nil { - return _node, err - } - _spec := sqlgraph.NewUpdateSpec(loadbalancerstatus.Table, loadbalancerstatus.Columns, sqlgraph.NewFieldSpec(loadbalancerstatus.FieldID, field.TypeString)) - id, ok := lbsuo.mutation.ID() - if !ok { - return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "LoadBalancerStatus.id" for update`)} - } - _spec.Node.ID.Value = id - if fields := lbsuo.fields; len(fields) > 0 { - _spec.Node.Columns = make([]string, 0, len(fields)) - _spec.Node.Columns = append(_spec.Node.Columns, loadbalancerstatus.FieldID) - for _, f := range fields { - if !loadbalancerstatus.ValidColumn(f) { - return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} - } - if f != loadbalancerstatus.FieldID { - _spec.Node.Columns = append(_spec.Node.Columns, f) - } - } - } - if ps := lbsuo.mutation.predicates; len(ps) > 0 { - _spec.Predicate = func(selector *sql.Selector) { - for i := range ps { - ps[i](selector) - } - } - } - if value, ok := lbsuo.mutation.UpdatedAt(); ok { - _spec.SetField(loadbalancerstatus.FieldUpdatedAt, field.TypeTime, value) - } - _node = &LoadBalancerStatus{config: lbsuo.config} - _spec.Assign = _node.assignValues - _spec.ScanValues = _node.scanValues - if err = sqlgraph.UpdateNode(ctx, lbsuo.driver, _spec); err != nil { - if _, ok := err.(*sqlgraph.NotFoundError); ok { - err = &NotFoundError{loadbalancerstatus.Label} - } else if sqlgraph.IsConstraintError(err) { - err = &ConstraintError{msg: err.Error(), wrap: err} - } - return nil, err - } - lbsuo.mutation.done = true - return _node, nil -} diff --git a/internal/ent/generated/migrate/migrate.go b/internal/ent/generated/migrate/migrate.go index b5489ddca..e84f88595 100644 --- a/internal/ent/generated/migrate/migrate.go +++ b/internal/ent/generated/migrate/migrate.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/migrate/schema.go b/internal/ent/generated/migrate/schema.go index 57e4db503..9baf0ef8e 100644 --- a/internal/ent/generated/migrate/schema.go +++ b/internal/ent/generated/migrate/schema.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -63,88 +73,6 @@ var ( }, }, } - // LoadBalancerAnnotationsColumns holds the columns for the "load_balancer_annotations" table. - LoadBalancerAnnotationsColumns = []*schema.Column{ - {Name: "id", Type: field.TypeString, Unique: true}, - {Name: "created_at", Type: field.TypeTime}, - {Name: "updated_at", Type: field.TypeTime}, - {Name: "load_balancer_id", Type: field.TypeString}, - } - // LoadBalancerAnnotationsTable holds the schema information for the "load_balancer_annotations" table. - LoadBalancerAnnotationsTable = &schema.Table{ - Name: "load_balancer_annotations", - Columns: LoadBalancerAnnotationsColumns, - PrimaryKey: []*schema.Column{LoadBalancerAnnotationsColumns[0]}, - ForeignKeys: []*schema.ForeignKey{ - { - Symbol: "load_balancer_annotations_load_balancers_load_balancer", - Columns: []*schema.Column{LoadBalancerAnnotationsColumns[3]}, - RefColumns: []*schema.Column{LoadBalancersColumns[0]}, - OnDelete: schema.NoAction, - }, - }, - Indexes: []*schema.Index{ - { - Name: "loadbalancerannotation_created_at", - Unique: false, - Columns: []*schema.Column{LoadBalancerAnnotationsColumns[1]}, - }, - { - Name: "loadbalancerannotation_updated_at", - Unique: false, - Columns: []*schema.Column{LoadBalancerAnnotationsColumns[2]}, - }, - { - Name: "loadbalancerannotation_load_balancer_id", - Unique: false, - Columns: []*schema.Column{LoadBalancerAnnotationsColumns[3]}, - }, - }, - } - // LoadBalancerStatusColumns holds the columns for the "load_balancer_status" table. - LoadBalancerStatusColumns = []*schema.Column{ - {Name: "id", Type: field.TypeString, Unique: true}, - {Name: "created_at", Type: field.TypeTime}, - {Name: "updated_at", Type: field.TypeTime}, - {Name: "source", Type: field.TypeString}, - {Name: "load_balancer_id", Type: field.TypeString}, - } - // LoadBalancerStatusTable holds the schema information for the "load_balancer_status" table. - LoadBalancerStatusTable = &schema.Table{ - Name: "load_balancer_status", - Columns: LoadBalancerStatusColumns, - PrimaryKey: []*schema.Column{LoadBalancerStatusColumns[0]}, - ForeignKeys: []*schema.ForeignKey{ - { - Symbol: "load_balancer_status_load_balancers_load_balancer", - Columns: []*schema.Column{LoadBalancerStatusColumns[4]}, - RefColumns: []*schema.Column{LoadBalancersColumns[0]}, - OnDelete: schema.NoAction, - }, - }, - Indexes: []*schema.Index{ - { - Name: "loadbalancerstatus_created_at", - Unique: false, - Columns: []*schema.Column{LoadBalancerStatusColumns[1]}, - }, - { - Name: "loadbalancerstatus_updated_at", - Unique: false, - Columns: []*schema.Column{LoadBalancerStatusColumns[2]}, - }, - { - Name: "loadbalancerstatus_load_balancer_id", - Unique: false, - Columns: []*schema.Column{LoadBalancerStatusColumns[4]}, - }, - { - Name: "loadbalancerstatus_load_balancer_id_source", - Unique: false, - Columns: []*schema.Column{LoadBalancerStatusColumns[4], LoadBalancerStatusColumns[3]}, - }, - }, - } // OriginsColumns holds the columns for the "origins" table. OriginsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true}, @@ -323,8 +251,6 @@ var ( // Tables holds all the tables in the schema. Tables = []*schema.Table{ LoadBalancersTable, - LoadBalancerAnnotationsTable, - LoadBalancerStatusTable, OriginsTable, PoolsTable, PortsTable, @@ -335,8 +261,6 @@ var ( func init() { LoadBalancersTable.ForeignKeys[0].RefTable = ProvidersTable - LoadBalancerAnnotationsTable.ForeignKeys[0].RefTable = LoadBalancersTable - LoadBalancerStatusTable.ForeignKeys[0].RefTable = LoadBalancersTable OriginsTable.ForeignKeys[0].RefTable = PoolsTable PortsTable.ForeignKeys[0].RefTable = LoadBalancersTable PoolPortsTable.ForeignKeys[0].RefTable = PoolsTable diff --git a/internal/ent/generated/mutation.go b/internal/ent/generated/mutation.go index 9dc90e0a6..7da591217 100644 --- a/internal/ent/generated/mutation.go +++ b/internal/ent/generated/mutation.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -16,8 +26,6 @@ import ( "entgo.io/ent" "entgo.io/ent/dialect/sql" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "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" @@ -35,41 +43,33 @@ const ( OpUpdateOne = ent.OpUpdateOne // Node types. - TypeLoadBalancer = "LoadBalancer" - TypeLoadBalancerAnnotation = "LoadBalancerAnnotation" - TypeLoadBalancerStatus = "LoadBalancerStatus" - TypeOrigin = "Origin" - TypePool = "Pool" - TypePort = "Port" - TypeProvider = "Provider" + TypeLoadBalancer = "LoadBalancer" + TypeOrigin = "Origin" + TypePool = "Pool" + TypePort = "Port" + TypeProvider = "Provider" ) // LoadBalancerMutation represents an operation that mutates the LoadBalancer nodes in the graph. type LoadBalancerMutation struct { config - op Op - typ string - id *gidx.PrefixedID - created_at *time.Time - updated_at *time.Time - name *string - owner_id *gidx.PrefixedID - location_id *gidx.PrefixedID - clearedFields map[string]struct{} - annotations map[gidx.PrefixedID]struct{} - removedannotations map[gidx.PrefixedID]struct{} - clearedannotations bool - statuses map[gidx.PrefixedID]struct{} - removedstatuses map[gidx.PrefixedID]struct{} - clearedstatuses bool - ports map[gidx.PrefixedID]struct{} - removedports map[gidx.PrefixedID]struct{} - clearedports bool - provider *gidx.PrefixedID - clearedprovider bool - done bool - oldValue func(context.Context) (*LoadBalancer, error) - predicates []predicate.LoadBalancer + op Op + typ string + id *gidx.PrefixedID + created_at *time.Time + updated_at *time.Time + name *string + owner_id *gidx.PrefixedID + location_id *gidx.PrefixedID + clearedFields map[string]struct{} + ports map[gidx.PrefixedID]struct{} + removedports map[gidx.PrefixedID]struct{} + clearedports bool + provider *gidx.PrefixedID + clearedprovider bool + done bool + oldValue func(context.Context) (*LoadBalancer, error) + predicates []predicate.LoadBalancer } var _ ent.Mutation = (*LoadBalancerMutation)(nil) @@ -392,114 +392,6 @@ func (m *LoadBalancerMutation) ResetProviderID() { m.provider = nil } -// AddAnnotationIDs adds the "annotations" edge to the LoadBalancerAnnotation entity by ids. -func (m *LoadBalancerMutation) AddAnnotationIDs(ids ...gidx.PrefixedID) { - if m.annotations == nil { - m.annotations = make(map[gidx.PrefixedID]struct{}) - } - for i := range ids { - m.annotations[ids[i]] = struct{}{} - } -} - -// ClearAnnotations clears the "annotations" edge to the LoadBalancerAnnotation entity. -func (m *LoadBalancerMutation) ClearAnnotations() { - m.clearedannotations = true -} - -// AnnotationsCleared reports if the "annotations" edge to the LoadBalancerAnnotation entity was cleared. -func (m *LoadBalancerMutation) AnnotationsCleared() bool { - return m.clearedannotations -} - -// RemoveAnnotationIDs removes the "annotations" edge to the LoadBalancerAnnotation entity by IDs. -func (m *LoadBalancerMutation) RemoveAnnotationIDs(ids ...gidx.PrefixedID) { - if m.removedannotations == nil { - m.removedannotations = make(map[gidx.PrefixedID]struct{}) - } - for i := range ids { - delete(m.annotations, ids[i]) - m.removedannotations[ids[i]] = struct{}{} - } -} - -// RemovedAnnotations returns the removed IDs of the "annotations" edge to the LoadBalancerAnnotation entity. -func (m *LoadBalancerMutation) RemovedAnnotationsIDs() (ids []gidx.PrefixedID) { - for id := range m.removedannotations { - ids = append(ids, id) - } - return -} - -// AnnotationsIDs returns the "annotations" edge IDs in the mutation. -func (m *LoadBalancerMutation) AnnotationsIDs() (ids []gidx.PrefixedID) { - for id := range m.annotations { - ids = append(ids, id) - } - return -} - -// ResetAnnotations resets all changes to the "annotations" edge. -func (m *LoadBalancerMutation) ResetAnnotations() { - m.annotations = nil - m.clearedannotations = false - m.removedannotations = nil -} - -// AddStatusIDs adds the "statuses" edge to the LoadBalancerStatus entity by ids. -func (m *LoadBalancerMutation) AddStatusIDs(ids ...gidx.PrefixedID) { - if m.statuses == nil { - m.statuses = make(map[gidx.PrefixedID]struct{}) - } - for i := range ids { - m.statuses[ids[i]] = struct{}{} - } -} - -// ClearStatuses clears the "statuses" edge to the LoadBalancerStatus entity. -func (m *LoadBalancerMutation) ClearStatuses() { - m.clearedstatuses = true -} - -// StatusesCleared reports if the "statuses" edge to the LoadBalancerStatus entity was cleared. -func (m *LoadBalancerMutation) StatusesCleared() bool { - return m.clearedstatuses -} - -// RemoveStatusIDs removes the "statuses" edge to the LoadBalancerStatus entity by IDs. -func (m *LoadBalancerMutation) RemoveStatusIDs(ids ...gidx.PrefixedID) { - if m.removedstatuses == nil { - m.removedstatuses = make(map[gidx.PrefixedID]struct{}) - } - for i := range ids { - delete(m.statuses, ids[i]) - m.removedstatuses[ids[i]] = struct{}{} - } -} - -// RemovedStatuses returns the removed IDs of the "statuses" edge to the LoadBalancerStatus entity. -func (m *LoadBalancerMutation) RemovedStatusesIDs() (ids []gidx.PrefixedID) { - for id := range m.removedstatuses { - ids = append(ids, id) - } - return -} - -// StatusesIDs returns the "statuses" edge IDs in the mutation. -func (m *LoadBalancerMutation) StatusesIDs() (ids []gidx.PrefixedID) { - for id := range m.statuses { - ids = append(ids, id) - } - return -} - -// ResetStatuses resets all changes to the "statuses" edge. -func (m *LoadBalancerMutation) ResetStatuses() { - m.statuses = nil - m.clearedstatuses = false - m.removedstatuses = nil -} - // AddPortIDs adds the "ports" edge to the Port entity by ids. func (m *LoadBalancerMutation) AddPortIDs(ids ...gidx.PrefixedID) { if m.ports == nil { @@ -798,13 +690,7 @@ func (m *LoadBalancerMutation) ResetField(name string) error { // AddedEdges returns all edge names that were set/added in this mutation. func (m *LoadBalancerMutation) AddedEdges() []string { - edges := make([]string, 0, 4) - if m.annotations != nil { - edges = append(edges, loadbalancer.EdgeAnnotations) - } - if m.statuses != nil { - edges = append(edges, loadbalancer.EdgeStatuses) - } + edges := make([]string, 0, 2) if m.ports != nil { edges = append(edges, loadbalancer.EdgePorts) } @@ -818,18 +704,6 @@ func (m *LoadBalancerMutation) AddedEdges() []string { // name in this mutation. func (m *LoadBalancerMutation) AddedIDs(name string) []ent.Value { switch name { - case loadbalancer.EdgeAnnotations: - ids := make([]ent.Value, 0, len(m.annotations)) - for id := range m.annotations { - ids = append(ids, id) - } - return ids - case loadbalancer.EdgeStatuses: - ids := make([]ent.Value, 0, len(m.statuses)) - for id := range m.statuses { - ids = append(ids, id) - } - return ids case loadbalancer.EdgePorts: ids := make([]ent.Value, 0, len(m.ports)) for id := range m.ports { @@ -846,13 +720,7 @@ func (m *LoadBalancerMutation) AddedIDs(name string) []ent.Value { // RemovedEdges returns all edge names that were removed in this mutation. func (m *LoadBalancerMutation) RemovedEdges() []string { - edges := make([]string, 0, 4) - if m.removedannotations != nil { - edges = append(edges, loadbalancer.EdgeAnnotations) - } - if m.removedstatuses != nil { - edges = append(edges, loadbalancer.EdgeStatuses) - } + edges := make([]string, 0, 2) if m.removedports != nil { edges = append(edges, loadbalancer.EdgePorts) } @@ -863,18 +731,6 @@ func (m *LoadBalancerMutation) RemovedEdges() []string { // the given name in this mutation. func (m *LoadBalancerMutation) RemovedIDs(name string) []ent.Value { switch name { - case loadbalancer.EdgeAnnotations: - ids := make([]ent.Value, 0, len(m.removedannotations)) - for id := range m.removedannotations { - ids = append(ids, id) - } - return ids - case loadbalancer.EdgeStatuses: - ids := make([]ent.Value, 0, len(m.removedstatuses)) - for id := range m.removedstatuses { - ids = append(ids, id) - } - return ids case loadbalancer.EdgePorts: ids := make([]ent.Value, 0, len(m.removedports)) for id := range m.removedports { @@ -887,13 +743,7 @@ func (m *LoadBalancerMutation) RemovedIDs(name string) []ent.Value { // ClearedEdges returns all edge names that were cleared in this mutation. func (m *LoadBalancerMutation) ClearedEdges() []string { - edges := make([]string, 0, 4) - if m.clearedannotations { - edges = append(edges, loadbalancer.EdgeAnnotations) - } - if m.clearedstatuses { - edges = append(edges, loadbalancer.EdgeStatuses) - } + edges := make([]string, 0, 2) if m.clearedports { edges = append(edges, loadbalancer.EdgePorts) } @@ -907,10 +757,6 @@ func (m *LoadBalancerMutation) ClearedEdges() []string { // was cleared in this mutation. func (m *LoadBalancerMutation) EdgeCleared(name string) bool { switch name { - case loadbalancer.EdgeAnnotations: - return m.clearedannotations - case loadbalancer.EdgeStatuses: - return m.clearedstatuses case loadbalancer.EdgePorts: return m.clearedports case loadbalancer.EdgeProvider: @@ -934,12 +780,6 @@ func (m *LoadBalancerMutation) ClearEdge(name string) error { // It returns an error if the edge is not defined in the schema. func (m *LoadBalancerMutation) ResetEdge(name string) error { switch name { - case loadbalancer.EdgeAnnotations: - m.ResetAnnotations() - return nil - case loadbalancer.EdgeStatuses: - m.ResetStatuses() - return nil case loadbalancer.EdgePorts: m.ResetPorts() return nil @@ -950,1046 +790,6 @@ func (m *LoadBalancerMutation) ResetEdge(name string) error { return fmt.Errorf("unknown LoadBalancer edge %s", name) } -// LoadBalancerAnnotationMutation represents an operation that mutates the LoadBalancerAnnotation nodes in the graph. -type LoadBalancerAnnotationMutation struct { - config - op Op - typ string - id *gidx.PrefixedID - created_at *time.Time - updated_at *time.Time - clearedFields map[string]struct{} - load_balancer *gidx.PrefixedID - clearedload_balancer bool - done bool - oldValue func(context.Context) (*LoadBalancerAnnotation, error) - predicates []predicate.LoadBalancerAnnotation -} - -var _ ent.Mutation = (*LoadBalancerAnnotationMutation)(nil) - -// loadbalancerannotationOption allows management of the mutation configuration using functional options. -type loadbalancerannotationOption func(*LoadBalancerAnnotationMutation) - -// newLoadBalancerAnnotationMutation creates new mutation for the LoadBalancerAnnotation entity. -func newLoadBalancerAnnotationMutation(c config, op Op, opts ...loadbalancerannotationOption) *LoadBalancerAnnotationMutation { - m := &LoadBalancerAnnotationMutation{ - config: c, - op: op, - typ: TypeLoadBalancerAnnotation, - clearedFields: make(map[string]struct{}), - } - for _, opt := range opts { - opt(m) - } - return m -} - -// withLoadBalancerAnnotationID sets the ID field of the mutation. -func withLoadBalancerAnnotationID(id gidx.PrefixedID) loadbalancerannotationOption { - return func(m *LoadBalancerAnnotationMutation) { - var ( - err error - once sync.Once - value *LoadBalancerAnnotation - ) - m.oldValue = func(ctx context.Context) (*LoadBalancerAnnotation, error) { - once.Do(func() { - if m.done { - err = errors.New("querying old values post mutation is not allowed") - } else { - value, err = m.Client().LoadBalancerAnnotation.Get(ctx, id) - } - }) - return value, err - } - m.id = &id - } -} - -// withLoadBalancerAnnotation sets the old LoadBalancerAnnotation of the mutation. -func withLoadBalancerAnnotation(node *LoadBalancerAnnotation) loadbalancerannotationOption { - return func(m *LoadBalancerAnnotationMutation) { - m.oldValue = func(context.Context) (*LoadBalancerAnnotation, error) { - return node, nil - } - m.id = &node.ID - } -} - -// Client returns a new `ent.Client` from the mutation. If the mutation was -// executed in a transaction (ent.Tx), a transactional client is returned. -func (m LoadBalancerAnnotationMutation) Client() *Client { - client := &Client{config: m.config} - client.init() - return client -} - -// Tx returns an `ent.Tx` for mutations that were executed in transactions; -// it returns an error otherwise. -func (m LoadBalancerAnnotationMutation) Tx() (*Tx, error) { - if _, ok := m.driver.(*txDriver); !ok { - return nil, errors.New("generated: mutation is not running in a transaction") - } - tx := &Tx{config: m.config} - tx.init() - return tx, nil -} - -// SetID sets the value of the id field. Note that this -// operation is only accepted on creation of LoadBalancerAnnotation entities. -func (m *LoadBalancerAnnotationMutation) SetID(id gidx.PrefixedID) { - m.id = &id -} - -// ID returns the ID value in the mutation. Note that the ID is only available -// if it was provided to the builder or after it was returned from the database. -func (m *LoadBalancerAnnotationMutation) ID() (id gidx.PrefixedID, exists bool) { - if m.id == nil { - return - } - return *m.id, true -} - -// IDs queries the database and returns the entity ids that match the mutation's predicate. -// That means, if the mutation is applied within a transaction with an isolation level such -// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated -// or updated by the mutation. -func (m *LoadBalancerAnnotationMutation) IDs(ctx context.Context) ([]gidx.PrefixedID, error) { - switch { - case m.op.Is(OpUpdateOne | OpDeleteOne): - id, exists := m.ID() - if exists { - return []gidx.PrefixedID{id}, nil - } - fallthrough - case m.op.Is(OpUpdate | OpDelete): - return m.Client().LoadBalancerAnnotation.Query().Where(m.predicates...).IDs(ctx) - default: - return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) - } -} - -// SetCreatedAt sets the "created_at" field. -func (m *LoadBalancerAnnotationMutation) SetCreatedAt(t time.Time) { - m.created_at = &t -} - -// CreatedAt returns the value of the "created_at" field in the mutation. -func (m *LoadBalancerAnnotationMutation) CreatedAt() (r time.Time, exists bool) { - v := m.created_at - if v == nil { - return - } - return *v, true -} - -// OldCreatedAt returns the old "created_at" field's value of the LoadBalancerAnnotation entity. -// If the LoadBalancerAnnotation 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 *LoadBalancerAnnotationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldCreatedAt requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) - } - return oldValue.CreatedAt, nil -} - -// ResetCreatedAt resets all changes to the "created_at" field. -func (m *LoadBalancerAnnotationMutation) ResetCreatedAt() { - m.created_at = nil -} - -// SetUpdatedAt sets the "updated_at" field. -func (m *LoadBalancerAnnotationMutation) SetUpdatedAt(t time.Time) { - m.updated_at = &t -} - -// UpdatedAt returns the value of the "updated_at" field in the mutation. -func (m *LoadBalancerAnnotationMutation) UpdatedAt() (r time.Time, exists bool) { - v := m.updated_at - if v == nil { - return - } - return *v, true -} - -// OldUpdatedAt returns the old "updated_at" field's value of the LoadBalancerAnnotation entity. -// If the LoadBalancerAnnotation 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 *LoadBalancerAnnotationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldUpdatedAt requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) - } - return oldValue.UpdatedAt, nil -} - -// ResetUpdatedAt resets all changes to the "updated_at" field. -func (m *LoadBalancerAnnotationMutation) ResetUpdatedAt() { - m.updated_at = nil -} - -// SetLoadBalancerID sets the "load_balancer_id" field. -func (m *LoadBalancerAnnotationMutation) SetLoadBalancerID(gi gidx.PrefixedID) { - m.load_balancer = &gi -} - -// LoadBalancerID returns the value of the "load_balancer_id" field in the mutation. -func (m *LoadBalancerAnnotationMutation) LoadBalancerID() (r gidx.PrefixedID, exists bool) { - v := m.load_balancer - if v == nil { - return - } - return *v, true -} - -// OldLoadBalancerID returns the old "load_balancer_id" field's value of the LoadBalancerAnnotation entity. -// If the LoadBalancerAnnotation 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 *LoadBalancerAnnotationMutation) OldLoadBalancerID(ctx context.Context) (v gidx.PrefixedID, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldLoadBalancerID is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldLoadBalancerID requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldLoadBalancerID: %w", err) - } - return oldValue.LoadBalancerID, nil -} - -// ResetLoadBalancerID resets all changes to the "load_balancer_id" field. -func (m *LoadBalancerAnnotationMutation) ResetLoadBalancerID() { - m.load_balancer = nil -} - -// ClearLoadBalancer clears the "load_balancer" edge to the LoadBalancer entity. -func (m *LoadBalancerAnnotationMutation) ClearLoadBalancer() { - m.clearedload_balancer = true -} - -// LoadBalancerCleared reports if the "load_balancer" edge to the LoadBalancer entity was cleared. -func (m *LoadBalancerAnnotationMutation) LoadBalancerCleared() bool { - return m.clearedload_balancer -} - -// LoadBalancerIDs returns the "load_balancer" edge IDs in the mutation. -// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use -// LoadBalancerID instead. It exists only for internal usage by the builders. -func (m *LoadBalancerAnnotationMutation) LoadBalancerIDs() (ids []gidx.PrefixedID) { - if id := m.load_balancer; id != nil { - ids = append(ids, *id) - } - return -} - -// ResetLoadBalancer resets all changes to the "load_balancer" edge. -func (m *LoadBalancerAnnotationMutation) ResetLoadBalancer() { - m.load_balancer = nil - m.clearedload_balancer = false -} - -// Where appends a list predicates to the LoadBalancerAnnotationMutation builder. -func (m *LoadBalancerAnnotationMutation) Where(ps ...predicate.LoadBalancerAnnotation) { - m.predicates = append(m.predicates, ps...) -} - -// WhereP appends storage-level predicates to the LoadBalancerAnnotationMutation builder. Using this method, -// users can use type-assertion to append predicates that do not depend on any generated package. -func (m *LoadBalancerAnnotationMutation) WhereP(ps ...func(*sql.Selector)) { - p := make([]predicate.LoadBalancerAnnotation, len(ps)) - for i := range ps { - p[i] = ps[i] - } - m.Where(p...) -} - -// Op returns the operation name. -func (m *LoadBalancerAnnotationMutation) Op() Op { - return m.op -} - -// SetOp allows setting the mutation operation. -func (m *LoadBalancerAnnotationMutation) SetOp(op Op) { - m.op = op -} - -// Type returns the node type of this mutation (LoadBalancerAnnotation). -func (m *LoadBalancerAnnotationMutation) Type() string { - return m.typ -} - -// Fields returns all fields that were changed during this mutation. Note that in -// order to get all numeric fields that were incremented/decremented, call -// AddedFields(). -func (m *LoadBalancerAnnotationMutation) Fields() []string { - fields := make([]string, 0, 3) - if m.created_at != nil { - fields = append(fields, loadbalancerannotation.FieldCreatedAt) - } - if m.updated_at != nil { - fields = append(fields, loadbalancerannotation.FieldUpdatedAt) - } - if m.load_balancer != nil { - fields = append(fields, loadbalancerannotation.FieldLoadBalancerID) - } - return fields -} - -// Field returns the value of a field with the given name. The second boolean -// return value indicates that this field was not set, or was not defined in the -// schema. -func (m *LoadBalancerAnnotationMutation) Field(name string) (ent.Value, bool) { - switch name { - case loadbalancerannotation.FieldCreatedAt: - return m.CreatedAt() - case loadbalancerannotation.FieldUpdatedAt: - return m.UpdatedAt() - case loadbalancerannotation.FieldLoadBalancerID: - return m.LoadBalancerID() - } - return nil, false -} - -// OldField returns the old value of the field from the database. An error is -// returned if the mutation operation is not UpdateOne, or the query to the -// database failed. -func (m *LoadBalancerAnnotationMutation) OldField(ctx context.Context, name string) (ent.Value, error) { - switch name { - case loadbalancerannotation.FieldCreatedAt: - return m.OldCreatedAt(ctx) - case loadbalancerannotation.FieldUpdatedAt: - return m.OldUpdatedAt(ctx) - case loadbalancerannotation.FieldLoadBalancerID: - return m.OldLoadBalancerID(ctx) - } - return nil, fmt.Errorf("unknown LoadBalancerAnnotation field %s", name) -} - -// SetField sets the value of a field with the given name. It returns an error if -// the field is not defined in the schema, or if the type mismatched the field -// type. -func (m *LoadBalancerAnnotationMutation) SetField(name string, value ent.Value) error { - switch name { - case loadbalancerannotation.FieldCreatedAt: - v, ok := value.(time.Time) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetCreatedAt(v) - return nil - case loadbalancerannotation.FieldUpdatedAt: - v, ok := value.(time.Time) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetUpdatedAt(v) - return nil - case loadbalancerannotation.FieldLoadBalancerID: - v, ok := value.(gidx.PrefixedID) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetLoadBalancerID(v) - return nil - } - return fmt.Errorf("unknown LoadBalancerAnnotation field %s", name) -} - -// AddedFields returns all numeric fields that were incremented/decremented during -// this mutation. -func (m *LoadBalancerAnnotationMutation) AddedFields() []string { - return nil -} - -// AddedField returns the numeric value that was incremented/decremented on a field -// with the given name. The second boolean return value indicates that this field -// was not set, or was not defined in the schema. -func (m *LoadBalancerAnnotationMutation) AddedField(name string) (ent.Value, bool) { - return nil, false -} - -// AddField adds the value to the field with the given name. It returns an error if -// the field is not defined in the schema, or if the type mismatched the field -// type. -func (m *LoadBalancerAnnotationMutation) AddField(name string, value ent.Value) error { - switch name { - } - return fmt.Errorf("unknown LoadBalancerAnnotation numeric field %s", name) -} - -// ClearedFields returns all nullable fields that were cleared during this -// mutation. -func (m *LoadBalancerAnnotationMutation) ClearedFields() []string { - return nil -} - -// FieldCleared returns a boolean indicating if a field with the given name was -// cleared in this mutation. -func (m *LoadBalancerAnnotationMutation) FieldCleared(name string) bool { - _, ok := m.clearedFields[name] - return ok -} - -// 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 *LoadBalancerAnnotationMutation) ClearField(name string) error { - return fmt.Errorf("unknown LoadBalancerAnnotation nullable field %s", name) -} - -// ResetField resets all changes in the mutation for the field with the given name. -// It returns an error if the field is not defined in the schema. -func (m *LoadBalancerAnnotationMutation) ResetField(name string) error { - switch name { - case loadbalancerannotation.FieldCreatedAt: - m.ResetCreatedAt() - return nil - case loadbalancerannotation.FieldUpdatedAt: - m.ResetUpdatedAt() - return nil - case loadbalancerannotation.FieldLoadBalancerID: - m.ResetLoadBalancerID() - return nil - } - return fmt.Errorf("unknown LoadBalancerAnnotation field %s", name) -} - -// AddedEdges returns all edge names that were set/added in this mutation. -func (m *LoadBalancerAnnotationMutation) AddedEdges() []string { - edges := make([]string, 0, 1) - if m.load_balancer != nil { - edges = append(edges, loadbalancerannotation.EdgeLoadBalancer) - } - return edges -} - -// AddedIDs returns all IDs (to other nodes) that were added for the given edge -// name in this mutation. -func (m *LoadBalancerAnnotationMutation) AddedIDs(name string) []ent.Value { - switch name { - case loadbalancerannotation.EdgeLoadBalancer: - if id := m.load_balancer; id != nil { - return []ent.Value{*id} - } - } - return nil -} - -// RemovedEdges returns all edge names that were removed in this mutation. -func (m *LoadBalancerAnnotationMutation) RemovedEdges() []string { - edges := make([]string, 0, 1) - return edges -} - -// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with -// the given name in this mutation. -func (m *LoadBalancerAnnotationMutation) RemovedIDs(name string) []ent.Value { - return nil -} - -// ClearedEdges returns all edge names that were cleared in this mutation. -func (m *LoadBalancerAnnotationMutation) ClearedEdges() []string { - edges := make([]string, 0, 1) - if m.clearedload_balancer { - edges = append(edges, loadbalancerannotation.EdgeLoadBalancer) - } - return edges -} - -// EdgeCleared returns a boolean which indicates if the edge with the given name -// was cleared in this mutation. -func (m *LoadBalancerAnnotationMutation) EdgeCleared(name string) bool { - switch name { - case loadbalancerannotation.EdgeLoadBalancer: - return m.clearedload_balancer - } - return false -} - -// ClearEdge clears the value of the edge with the given name. It returns an error -// if that edge is not defined in the schema. -func (m *LoadBalancerAnnotationMutation) ClearEdge(name string) error { - switch name { - case loadbalancerannotation.EdgeLoadBalancer: - m.ClearLoadBalancer() - return nil - } - return fmt.Errorf("unknown LoadBalancerAnnotation unique edge %s", name) -} - -// ResetEdge resets all changes to the edge with the given name in this mutation. -// It returns an error if the edge is not defined in the schema. -func (m *LoadBalancerAnnotationMutation) ResetEdge(name string) error { - switch name { - case loadbalancerannotation.EdgeLoadBalancer: - m.ResetLoadBalancer() - return nil - } - return fmt.Errorf("unknown LoadBalancerAnnotation edge %s", name) -} - -// LoadBalancerStatusMutation represents an operation that mutates the LoadBalancerStatus nodes in the graph. -type LoadBalancerStatusMutation struct { - config - op Op - typ string - id *gidx.PrefixedID - created_at *time.Time - updated_at *time.Time - source *string - clearedFields map[string]struct{} - load_balancer *gidx.PrefixedID - clearedload_balancer bool - done bool - oldValue func(context.Context) (*LoadBalancerStatus, error) - predicates []predicate.LoadBalancerStatus -} - -var _ ent.Mutation = (*LoadBalancerStatusMutation)(nil) - -// loadbalancerstatusOption allows management of the mutation configuration using functional options. -type loadbalancerstatusOption func(*LoadBalancerStatusMutation) - -// newLoadBalancerStatusMutation creates new mutation for the LoadBalancerStatus entity. -func newLoadBalancerStatusMutation(c config, op Op, opts ...loadbalancerstatusOption) *LoadBalancerStatusMutation { - m := &LoadBalancerStatusMutation{ - config: c, - op: op, - typ: TypeLoadBalancerStatus, - clearedFields: make(map[string]struct{}), - } - for _, opt := range opts { - opt(m) - } - return m -} - -// withLoadBalancerStatusID sets the ID field of the mutation. -func withLoadBalancerStatusID(id gidx.PrefixedID) loadbalancerstatusOption { - return func(m *LoadBalancerStatusMutation) { - var ( - err error - once sync.Once - value *LoadBalancerStatus - ) - m.oldValue = func(ctx context.Context) (*LoadBalancerStatus, error) { - once.Do(func() { - if m.done { - err = errors.New("querying old values post mutation is not allowed") - } else { - value, err = m.Client().LoadBalancerStatus.Get(ctx, id) - } - }) - return value, err - } - m.id = &id - } -} - -// withLoadBalancerStatus sets the old LoadBalancerStatus of the mutation. -func withLoadBalancerStatus(node *LoadBalancerStatus) loadbalancerstatusOption { - return func(m *LoadBalancerStatusMutation) { - m.oldValue = func(context.Context) (*LoadBalancerStatus, error) { - return node, nil - } - m.id = &node.ID - } -} - -// Client returns a new `ent.Client` from the mutation. If the mutation was -// executed in a transaction (ent.Tx), a transactional client is returned. -func (m LoadBalancerStatusMutation) Client() *Client { - client := &Client{config: m.config} - client.init() - return client -} - -// Tx returns an `ent.Tx` for mutations that were executed in transactions; -// it returns an error otherwise. -func (m LoadBalancerStatusMutation) Tx() (*Tx, error) { - if _, ok := m.driver.(*txDriver); !ok { - return nil, errors.New("generated: mutation is not running in a transaction") - } - tx := &Tx{config: m.config} - tx.init() - return tx, nil -} - -// SetID sets the value of the id field. Note that this -// operation is only accepted on creation of LoadBalancerStatus entities. -func (m *LoadBalancerStatusMutation) SetID(id gidx.PrefixedID) { - m.id = &id -} - -// ID returns the ID value in the mutation. Note that the ID is only available -// if it was provided to the builder or after it was returned from the database. -func (m *LoadBalancerStatusMutation) ID() (id gidx.PrefixedID, exists bool) { - if m.id == nil { - return - } - return *m.id, true -} - -// IDs queries the database and returns the entity ids that match the mutation's predicate. -// That means, if the mutation is applied within a transaction with an isolation level such -// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated -// or updated by the mutation. -func (m *LoadBalancerStatusMutation) IDs(ctx context.Context) ([]gidx.PrefixedID, error) { - switch { - case m.op.Is(OpUpdateOne | OpDeleteOne): - id, exists := m.ID() - if exists { - return []gidx.PrefixedID{id}, nil - } - fallthrough - case m.op.Is(OpUpdate | OpDelete): - return m.Client().LoadBalancerStatus.Query().Where(m.predicates...).IDs(ctx) - default: - return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) - } -} - -// SetCreatedAt sets the "created_at" field. -func (m *LoadBalancerStatusMutation) SetCreatedAt(t time.Time) { - m.created_at = &t -} - -// CreatedAt returns the value of the "created_at" field in the mutation. -func (m *LoadBalancerStatusMutation) CreatedAt() (r time.Time, exists bool) { - v := m.created_at - if v == nil { - return - } - return *v, true -} - -// OldCreatedAt returns the old "created_at" field's value of the LoadBalancerStatus entity. -// If the LoadBalancerStatus 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 *LoadBalancerStatusMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldCreatedAt requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) - } - return oldValue.CreatedAt, nil -} - -// ResetCreatedAt resets all changes to the "created_at" field. -func (m *LoadBalancerStatusMutation) ResetCreatedAt() { - m.created_at = nil -} - -// SetUpdatedAt sets the "updated_at" field. -func (m *LoadBalancerStatusMutation) SetUpdatedAt(t time.Time) { - m.updated_at = &t -} - -// UpdatedAt returns the value of the "updated_at" field in the mutation. -func (m *LoadBalancerStatusMutation) UpdatedAt() (r time.Time, exists bool) { - v := m.updated_at - if v == nil { - return - } - return *v, true -} - -// OldUpdatedAt returns the old "updated_at" field's value of the LoadBalancerStatus entity. -// If the LoadBalancerStatus 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 *LoadBalancerStatusMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldUpdatedAt requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) - } - return oldValue.UpdatedAt, nil -} - -// ResetUpdatedAt resets all changes to the "updated_at" field. -func (m *LoadBalancerStatusMutation) ResetUpdatedAt() { - m.updated_at = nil -} - -// SetLoadBalancerID sets the "load_balancer_id" field. -func (m *LoadBalancerStatusMutation) SetLoadBalancerID(gi gidx.PrefixedID) { - m.load_balancer = &gi -} - -// LoadBalancerID returns the value of the "load_balancer_id" field in the mutation. -func (m *LoadBalancerStatusMutation) LoadBalancerID() (r gidx.PrefixedID, exists bool) { - v := m.load_balancer - if v == nil { - return - } - return *v, true -} - -// OldLoadBalancerID returns the old "load_balancer_id" field's value of the LoadBalancerStatus entity. -// If the LoadBalancerStatus 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 *LoadBalancerStatusMutation) OldLoadBalancerID(ctx context.Context) (v gidx.PrefixedID, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldLoadBalancerID is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldLoadBalancerID requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldLoadBalancerID: %w", err) - } - return oldValue.LoadBalancerID, nil -} - -// ResetLoadBalancerID resets all changes to the "load_balancer_id" field. -func (m *LoadBalancerStatusMutation) ResetLoadBalancerID() { - m.load_balancer = nil -} - -// SetSource sets the "source" field. -func (m *LoadBalancerStatusMutation) SetSource(s string) { - m.source = &s -} - -// Source returns the value of the "source" field in the mutation. -func (m *LoadBalancerStatusMutation) Source() (r string, exists bool) { - v := m.source - if v == nil { - return - } - return *v, true -} - -// OldSource returns the old "source" field's value of the LoadBalancerStatus entity. -// If the LoadBalancerStatus 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 *LoadBalancerStatusMutation) OldSource(ctx context.Context) (v string, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldSource is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldSource requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldSource: %w", err) - } - return oldValue.Source, nil -} - -// ResetSource resets all changes to the "source" field. -func (m *LoadBalancerStatusMutation) ResetSource() { - m.source = nil -} - -// ClearLoadBalancer clears the "load_balancer" edge to the LoadBalancer entity. -func (m *LoadBalancerStatusMutation) ClearLoadBalancer() { - m.clearedload_balancer = true -} - -// LoadBalancerCleared reports if the "load_balancer" edge to the LoadBalancer entity was cleared. -func (m *LoadBalancerStatusMutation) LoadBalancerCleared() bool { - return m.clearedload_balancer -} - -// LoadBalancerIDs returns the "load_balancer" edge IDs in the mutation. -// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use -// LoadBalancerID instead. It exists only for internal usage by the builders. -func (m *LoadBalancerStatusMutation) LoadBalancerIDs() (ids []gidx.PrefixedID) { - if id := m.load_balancer; id != nil { - ids = append(ids, *id) - } - return -} - -// ResetLoadBalancer resets all changes to the "load_balancer" edge. -func (m *LoadBalancerStatusMutation) ResetLoadBalancer() { - m.load_balancer = nil - m.clearedload_balancer = false -} - -// Where appends a list predicates to the LoadBalancerStatusMutation builder. -func (m *LoadBalancerStatusMutation) Where(ps ...predicate.LoadBalancerStatus) { - m.predicates = append(m.predicates, ps...) -} - -// WhereP appends storage-level predicates to the LoadBalancerStatusMutation builder. Using this method, -// users can use type-assertion to append predicates that do not depend on any generated package. -func (m *LoadBalancerStatusMutation) WhereP(ps ...func(*sql.Selector)) { - p := make([]predicate.LoadBalancerStatus, len(ps)) - for i := range ps { - p[i] = ps[i] - } - m.Where(p...) -} - -// Op returns the operation name. -func (m *LoadBalancerStatusMutation) Op() Op { - return m.op -} - -// SetOp allows setting the mutation operation. -func (m *LoadBalancerStatusMutation) SetOp(op Op) { - m.op = op -} - -// Type returns the node type of this mutation (LoadBalancerStatus). -func (m *LoadBalancerStatusMutation) Type() string { - return m.typ -} - -// Fields returns all fields that were changed during this mutation. Note that in -// order to get all numeric fields that were incremented/decremented, call -// AddedFields(). -func (m *LoadBalancerStatusMutation) Fields() []string { - fields := make([]string, 0, 4) - if m.created_at != nil { - fields = append(fields, loadbalancerstatus.FieldCreatedAt) - } - if m.updated_at != nil { - fields = append(fields, loadbalancerstatus.FieldUpdatedAt) - } - if m.load_balancer != nil { - fields = append(fields, loadbalancerstatus.FieldLoadBalancerID) - } - if m.source != nil { - fields = append(fields, loadbalancerstatus.FieldSource) - } - return fields -} - -// Field returns the value of a field with the given name. The second boolean -// return value indicates that this field was not set, or was not defined in the -// schema. -func (m *LoadBalancerStatusMutation) Field(name string) (ent.Value, bool) { - switch name { - case loadbalancerstatus.FieldCreatedAt: - return m.CreatedAt() - case loadbalancerstatus.FieldUpdatedAt: - return m.UpdatedAt() - case loadbalancerstatus.FieldLoadBalancerID: - return m.LoadBalancerID() - case loadbalancerstatus.FieldSource: - return m.Source() - } - return nil, false -} - -// OldField returns the old value of the field from the database. An error is -// returned if the mutation operation is not UpdateOne, or the query to the -// database failed. -func (m *LoadBalancerStatusMutation) OldField(ctx context.Context, name string) (ent.Value, error) { - switch name { - case loadbalancerstatus.FieldCreatedAt: - return m.OldCreatedAt(ctx) - case loadbalancerstatus.FieldUpdatedAt: - return m.OldUpdatedAt(ctx) - case loadbalancerstatus.FieldLoadBalancerID: - return m.OldLoadBalancerID(ctx) - case loadbalancerstatus.FieldSource: - return m.OldSource(ctx) - } - return nil, fmt.Errorf("unknown LoadBalancerStatus field %s", name) -} - -// SetField sets the value of a field with the given name. It returns an error if -// the field is not defined in the schema, or if the type mismatched the field -// type. -func (m *LoadBalancerStatusMutation) SetField(name string, value ent.Value) error { - switch name { - case loadbalancerstatus.FieldCreatedAt: - v, ok := value.(time.Time) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetCreatedAt(v) - return nil - case loadbalancerstatus.FieldUpdatedAt: - v, ok := value.(time.Time) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetUpdatedAt(v) - return nil - case loadbalancerstatus.FieldLoadBalancerID: - v, ok := value.(gidx.PrefixedID) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetLoadBalancerID(v) - return nil - case loadbalancerstatus.FieldSource: - v, ok := value.(string) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetSource(v) - return nil - } - return fmt.Errorf("unknown LoadBalancerStatus field %s", name) -} - -// AddedFields returns all numeric fields that were incremented/decremented during -// this mutation. -func (m *LoadBalancerStatusMutation) AddedFields() []string { - return nil -} - -// AddedField returns the numeric value that was incremented/decremented on a field -// with the given name. The second boolean return value indicates that this field -// was not set, or was not defined in the schema. -func (m *LoadBalancerStatusMutation) AddedField(name string) (ent.Value, bool) { - return nil, false -} - -// AddField adds the value to the field with the given name. It returns an error if -// the field is not defined in the schema, or if the type mismatched the field -// type. -func (m *LoadBalancerStatusMutation) AddField(name string, value ent.Value) error { - switch name { - } - return fmt.Errorf("unknown LoadBalancerStatus numeric field %s", name) -} - -// ClearedFields returns all nullable fields that were cleared during this -// mutation. -func (m *LoadBalancerStatusMutation) ClearedFields() []string { - return nil -} - -// FieldCleared returns a boolean indicating if a field with the given name was -// cleared in this mutation. -func (m *LoadBalancerStatusMutation) FieldCleared(name string) bool { - _, ok := m.clearedFields[name] - return ok -} - -// 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 *LoadBalancerStatusMutation) ClearField(name string) error { - return fmt.Errorf("unknown LoadBalancerStatus nullable field %s", name) -} - -// ResetField resets all changes in the mutation for the field with the given name. -// It returns an error if the field is not defined in the schema. -func (m *LoadBalancerStatusMutation) ResetField(name string) error { - switch name { - case loadbalancerstatus.FieldCreatedAt: - m.ResetCreatedAt() - return nil - case loadbalancerstatus.FieldUpdatedAt: - m.ResetUpdatedAt() - return nil - case loadbalancerstatus.FieldLoadBalancerID: - m.ResetLoadBalancerID() - return nil - case loadbalancerstatus.FieldSource: - m.ResetSource() - return nil - } - return fmt.Errorf("unknown LoadBalancerStatus field %s", name) -} - -// AddedEdges returns all edge names that were set/added in this mutation. -func (m *LoadBalancerStatusMutation) AddedEdges() []string { - edges := make([]string, 0, 1) - if m.load_balancer != nil { - edges = append(edges, loadbalancerstatus.EdgeLoadBalancer) - } - return edges -} - -// AddedIDs returns all IDs (to other nodes) that were added for the given edge -// name in this mutation. -func (m *LoadBalancerStatusMutation) AddedIDs(name string) []ent.Value { - switch name { - case loadbalancerstatus.EdgeLoadBalancer: - if id := m.load_balancer; id != nil { - return []ent.Value{*id} - } - } - return nil -} - -// RemovedEdges returns all edge names that were removed in this mutation. -func (m *LoadBalancerStatusMutation) RemovedEdges() []string { - edges := make([]string, 0, 1) - return edges -} - -// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with -// the given name in this mutation. -func (m *LoadBalancerStatusMutation) RemovedIDs(name string) []ent.Value { - return nil -} - -// ClearedEdges returns all edge names that were cleared in this mutation. -func (m *LoadBalancerStatusMutation) ClearedEdges() []string { - edges := make([]string, 0, 1) - if m.clearedload_balancer { - edges = append(edges, loadbalancerstatus.EdgeLoadBalancer) - } - return edges -} - -// EdgeCleared returns a boolean which indicates if the edge with the given name -// was cleared in this mutation. -func (m *LoadBalancerStatusMutation) EdgeCleared(name string) bool { - switch name { - case loadbalancerstatus.EdgeLoadBalancer: - return m.clearedload_balancer - } - return false -} - -// ClearEdge clears the value of the edge with the given name. It returns an error -// if that edge is not defined in the schema. -func (m *LoadBalancerStatusMutation) ClearEdge(name string) error { - switch name { - case loadbalancerstatus.EdgeLoadBalancer: - m.ClearLoadBalancer() - return nil - } - return fmt.Errorf("unknown LoadBalancerStatus unique edge %s", name) -} - -// ResetEdge resets all changes to the edge with the given name in this mutation. -// It returns an error if the edge is not defined in the schema. -func (m *LoadBalancerStatusMutation) ResetEdge(name string) error { - switch name { - case loadbalancerstatus.EdgeLoadBalancer: - m.ResetLoadBalancer() - return nil - } - return fmt.Errorf("unknown LoadBalancerStatus edge %s", name) -} - // OriginMutation represents an operation that mutates the Origin nodes in the graph. type OriginMutation struct { config diff --git a/internal/ent/generated/origin.go b/internal/ent/generated/origin.go index b843ac85a..6bdefcc7e 100644 --- a/internal/ent/generated/origin.go +++ b/internal/ent/generated/origin.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/origin/origin.go b/internal/ent/generated/origin/origin.go index df63510d8..c65d0fc50 100644 --- a/internal/ent/generated/origin/origin.go +++ b/internal/ent/generated/origin/origin.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/origin/where.go b/internal/ent/generated/origin/where.go index ebf89890b..9c99dcdc7 100644 --- a/internal/ent/generated/origin/where.go +++ b/internal/ent/generated/origin/where.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/origin_create.go b/internal/ent/generated/origin_create.go index fa67bd4f3..5d59dcd77 100644 --- a/internal/ent/generated/origin_create.go +++ b/internal/ent/generated/origin_create.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/origin_delete.go b/internal/ent/generated/origin_delete.go index 0bec7bffd..560e42097 100644 --- a/internal/ent/generated/origin_delete.go +++ b/internal/ent/generated/origin_delete.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/origin_query.go b/internal/ent/generated/origin_query.go index 06eb59de8..a9469fc2e 100644 --- a/internal/ent/generated/origin_query.go +++ b/internal/ent/generated/origin_query.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/origin_update.go b/internal/ent/generated/origin_update.go index 74924c734..1fc2fa8ce 100644 --- a/internal/ent/generated/origin_update.go +++ b/internal/ent/generated/origin_update.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/pool.go b/internal/ent/generated/pool.go index 6104661f9..6fb38ab55 100644 --- a/internal/ent/generated/pool.go +++ b/internal/ent/generated/pool.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/pool/pool.go b/internal/ent/generated/pool/pool.go index f5dcd7339..578fabf70 100644 --- a/internal/ent/generated/pool/pool.go +++ b/internal/ent/generated/pool/pool.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/pool/where.go b/internal/ent/generated/pool/where.go index 8764833e5..fba86ae74 100644 --- a/internal/ent/generated/pool/where.go +++ b/internal/ent/generated/pool/where.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/pool_create.go b/internal/ent/generated/pool_create.go index 9c3e8a532..e64576765 100644 --- a/internal/ent/generated/pool_create.go +++ b/internal/ent/generated/pool_create.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/pool_delete.go b/internal/ent/generated/pool_delete.go index ea0b792c5..df8d0e3a1 100644 --- a/internal/ent/generated/pool_delete.go +++ b/internal/ent/generated/pool_delete.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/pool_query.go b/internal/ent/generated/pool_query.go index 231945208..4a64f14bd 100644 --- a/internal/ent/generated/pool_query.go +++ b/internal/ent/generated/pool_query.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/pool_update.go b/internal/ent/generated/pool_update.go index 60fb84c5f..4703aa855 100644 --- a/internal/ent/generated/pool_update.go +++ b/internal/ent/generated/pool_update.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/port.go b/internal/ent/generated/port.go index e09fd2888..1af1c987b 100644 --- a/internal/ent/generated/port.go +++ b/internal/ent/generated/port.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/port/port.go b/internal/ent/generated/port/port.go index 4e70475d5..e66051d84 100644 --- a/internal/ent/generated/port/port.go +++ b/internal/ent/generated/port/port.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/port/where.go b/internal/ent/generated/port/where.go index 00b4d2e30..53052fe39 100644 --- a/internal/ent/generated/port/where.go +++ b/internal/ent/generated/port/where.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/port_create.go b/internal/ent/generated/port_create.go index 41035c2b0..faa892795 100644 --- a/internal/ent/generated/port_create.go +++ b/internal/ent/generated/port_create.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/port_delete.go b/internal/ent/generated/port_delete.go index a973ad225..9133b61f3 100644 --- a/internal/ent/generated/port_delete.go +++ b/internal/ent/generated/port_delete.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/port_query.go b/internal/ent/generated/port_query.go index 9ee0cca7f..4333c8356 100644 --- a/internal/ent/generated/port_query.go +++ b/internal/ent/generated/port_query.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/port_update.go b/internal/ent/generated/port_update.go index 65783c19a..eaafe3f94 100644 --- a/internal/ent/generated/port_update.go +++ b/internal/ent/generated/port_update.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/predicate/predicate.go b/internal/ent/generated/predicate/predicate.go index 02fb2bdc5..4076eaedd 100644 --- a/internal/ent/generated/predicate/predicate.go +++ b/internal/ent/generated/predicate/predicate.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -13,12 +23,6 @@ import ( // LoadBalancer is the predicate function for loadbalancer builders. type LoadBalancer func(*sql.Selector) -// LoadBalancerAnnotation is the predicate function for loadbalancerannotation builders. -type LoadBalancerAnnotation func(*sql.Selector) - -// LoadBalancerStatus is the predicate function for loadbalancerstatus builders. -type LoadBalancerStatus func(*sql.Selector) - // Origin is the predicate function for origin builders. type Origin func(*sql.Selector) diff --git a/internal/ent/generated/provider.go b/internal/ent/generated/provider.go index 33b626a79..28ed622f0 100644 --- a/internal/ent/generated/provider.go +++ b/internal/ent/generated/provider.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/provider/provider.go b/internal/ent/generated/provider/provider.go index 78ab1c26f..28aec5dae 100644 --- a/internal/ent/generated/provider/provider.go +++ b/internal/ent/generated/provider/provider.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/provider/where.go b/internal/ent/generated/provider/where.go index 5a81e0679..2489175a3 100644 --- a/internal/ent/generated/provider/where.go +++ b/internal/ent/generated/provider/where.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/provider_create.go b/internal/ent/generated/provider_create.go index 2e61543b8..4b9e93ff1 100644 --- a/internal/ent/generated/provider_create.go +++ b/internal/ent/generated/provider_create.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/provider_delete.go b/internal/ent/generated/provider_delete.go index a3a30973a..de83f1040 100644 --- a/internal/ent/generated/provider_delete.go +++ b/internal/ent/generated/provider_delete.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/provider_query.go b/internal/ent/generated/provider_query.go index 02993725b..b36666cc1 100644 --- a/internal/ent/generated/provider_query.go +++ b/internal/ent/generated/provider_query.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/provider_update.go b/internal/ent/generated/provider_update.go index 33f41f101..6db34a3a3 100644 --- a/internal/ent/generated/provider_update.go +++ b/internal/ent/generated/provider_update.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/pubsubhooks/pubsub.go b/internal/ent/generated/pubsubhooks/pubsub.go index 81ab94a97..01f495c45 100644 --- a/internal/ent/generated/pubsubhooks/pubsub.go +++ b/internal/ent/generated/pubsubhooks/pubsub.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/runtime.go b/internal/ent/generated/runtime.go index aa94b0cb0..dc8671f37 100644 --- a/internal/ent/generated/runtime.go +++ b/internal/ent/generated/runtime.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -10,8 +20,6 @@ import ( "time" "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancer" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerannotation" - "go.infratographer.com/load-balancer-api/internal/ent/generated/loadbalancerstatus" "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" @@ -55,48 +63,6 @@ func init() { loadbalancerDescID := loadbalancerFields[0].Descriptor() // loadbalancer.DefaultID holds the default value on creation for the id field. loadbalancer.DefaultID = loadbalancerDescID.Default.(func() gidx.PrefixedID) - loadbalancerannotationMixin := schema.LoadBalancerAnnotation{}.Mixin() - loadbalancerannotationMixinFields0 := loadbalancerannotationMixin[0].Fields() - _ = loadbalancerannotationMixinFields0 - loadbalancerannotationFields := schema.LoadBalancerAnnotation{}.Fields() - _ = loadbalancerannotationFields - // loadbalancerannotationDescCreatedAt is the schema descriptor for created_at field. - loadbalancerannotationDescCreatedAt := loadbalancerannotationMixinFields0[0].Descriptor() - // loadbalancerannotation.DefaultCreatedAt holds the default value on creation for the created_at field. - loadbalancerannotation.DefaultCreatedAt = loadbalancerannotationDescCreatedAt.Default.(func() time.Time) - // loadbalancerannotationDescUpdatedAt is the schema descriptor for updated_at field. - loadbalancerannotationDescUpdatedAt := loadbalancerannotationMixinFields0[1].Descriptor() - // loadbalancerannotation.DefaultUpdatedAt holds the default value on creation for the updated_at field. - loadbalancerannotation.DefaultUpdatedAt = loadbalancerannotationDescUpdatedAt.Default.(func() time.Time) - // loadbalancerannotation.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. - loadbalancerannotation.UpdateDefaultUpdatedAt = loadbalancerannotationDescUpdatedAt.UpdateDefault.(func() time.Time) - // loadbalancerannotationDescID is the schema descriptor for id field. - loadbalancerannotationDescID := loadbalancerannotationFields[0].Descriptor() - // loadbalancerannotation.DefaultID holds the default value on creation for the id field. - loadbalancerannotation.DefaultID = loadbalancerannotationDescID.Default.(func() gidx.PrefixedID) - loadbalancerstatusMixin := schema.LoadBalancerStatus{}.Mixin() - loadbalancerstatusMixinFields0 := loadbalancerstatusMixin[0].Fields() - _ = loadbalancerstatusMixinFields0 - loadbalancerstatusFields := schema.LoadBalancerStatus{}.Fields() - _ = loadbalancerstatusFields - // loadbalancerstatusDescCreatedAt is the schema descriptor for created_at field. - loadbalancerstatusDescCreatedAt := loadbalancerstatusMixinFields0[0].Descriptor() - // loadbalancerstatus.DefaultCreatedAt holds the default value on creation for the created_at field. - loadbalancerstatus.DefaultCreatedAt = loadbalancerstatusDescCreatedAt.Default.(func() time.Time) - // loadbalancerstatusDescUpdatedAt is the schema descriptor for updated_at field. - loadbalancerstatusDescUpdatedAt := loadbalancerstatusMixinFields0[1].Descriptor() - // loadbalancerstatus.DefaultUpdatedAt holds the default value on creation for the updated_at field. - loadbalancerstatus.DefaultUpdatedAt = loadbalancerstatusDescUpdatedAt.Default.(func() time.Time) - // loadbalancerstatus.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. - loadbalancerstatus.UpdateDefaultUpdatedAt = loadbalancerstatusDescUpdatedAt.UpdateDefault.(func() time.Time) - // loadbalancerstatusDescSource is the schema descriptor for source field. - loadbalancerstatusDescSource := loadbalancerstatusFields[2].Descriptor() - // loadbalancerstatus.SourceValidator is a validator for the "source" field. It is called by the builders before save. - loadbalancerstatus.SourceValidator = loadbalancerstatusDescSource.Validators[0].(func(string) error) - // loadbalancerstatusDescID is the schema descriptor for id field. - loadbalancerstatusDescID := loadbalancerstatusFields[0].Descriptor() - // loadbalancerstatus.DefaultID holds the default value on creation for the id field. - loadbalancerstatus.DefaultID = loadbalancerstatusDescID.Default.(func() gidx.PrefixedID) originMixin := schema.Origin{}.Mixin() originMixinFields0 := originMixin[0].Fields() _ = originMixinFields0 diff --git a/internal/ent/generated/runtime/runtime.go b/internal/ent/generated/runtime/runtime.go index bde3997b6..ceca9062c 100644 --- a/internal/ent/generated/runtime/runtime.go +++ b/internal/ent/generated/runtime/runtime.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. diff --git a/internal/ent/generated/tx.go b/internal/ent/generated/tx.go index cb620f175..d73bf4f1f 100644 --- a/internal/ent/generated/tx.go +++ b/internal/ent/generated/tx.go @@ -1,6 +1,16 @@ -// Copyright Infratographer, Inc. and/or licensed to Infratographer, Inc. under one -// or more contributor license agreements. Licensed under the Elastic License 2.0; -// you may not use this file except in compliance with the Elastic License 2.0. +// Copyright 2023 The Infratographer Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // // Code generated by entc, DO NOT EDIT. @@ -18,10 +28,6 @@ type Tx struct { config // LoadBalancer is the client for interacting with the LoadBalancer builders. LoadBalancer *LoadBalancerClient - // LoadBalancerAnnotation is the client for interacting with the LoadBalancerAnnotation builders. - LoadBalancerAnnotation *LoadBalancerAnnotationClient - // LoadBalancerStatus is the client for interacting with the LoadBalancerStatus builders. - LoadBalancerStatus *LoadBalancerStatusClient // Origin is the client for interacting with the Origin builders. Origin *OriginClient // Pool is the client for interacting with the Pool builders. @@ -162,8 +168,6 @@ func (tx *Tx) Client() *Client { func (tx *Tx) init() { tx.LoadBalancer = NewLoadBalancerClient(tx.config) - tx.LoadBalancerAnnotation = NewLoadBalancerAnnotationClient(tx.config) - tx.LoadBalancerStatus = NewLoadBalancerStatusClient(tx.config) tx.Origin = NewOriginClient(tx.config) tx.Pool = NewPoolClient(tx.config) tx.Port = NewPortClient(tx.config) diff --git a/internal/ent/schema/id_prefixes.go b/internal/ent/schema/id_prefixes.go index 2eba55a98..11ba3729c 100644 --- a/internal/ent/schema/id_prefixes.go +++ b/internal/ent/schema/id_prefixes.go @@ -5,10 +5,6 @@ const ( ApplicationPrefix string = "load" // LoadBalancerPrefix is the prefix for all load balancer IDs LoadBalancerPrefix string = ApplicationPrefix + "bal" - // LoadBalancerAnnotationPrefix is the prefix for all load balancer annotation IDs - LoadBalancerAnnotationPrefix string = ApplicationPrefix + "ban" - // LoadBalancerStatusPrefix is the prefix for all load balancer Status IDs - LoadBalancerStatusPrefix string = ApplicationPrefix + "bst" // LoadBalancerProviderPrefix is the prefix for all load balancer provider IDs LoadBalancerProviderPrefix string = ApplicationPrefix + "pvd" // OriginPrefix is the prefix for all origin IDs diff --git a/internal/ent/schema/lb_annotation.go b/internal/ent/schema/lb_annotation.go deleted file mode 100644 index 20d03fe4c..000000000 --- a/internal/ent/schema/lb_annotation.go +++ /dev/null @@ -1,69 +0,0 @@ -package schema - -import ( - "entgo.io/contrib/entgql" - "entgo.io/ent" - "entgo.io/ent/schema" - "entgo.io/ent/schema/edge" - "entgo.io/ent/schema/field" - "entgo.io/ent/schema/index" - "go.infratographer.com/x/entx" - "go.infratographer.com/x/gidx" -) - -// LoadBalancerAnnotation holds the schema definition for the LoadBalancerAnnotation entity. -type LoadBalancerAnnotation struct { - ent.Schema -} - -// Mixin of the LoadBalancerAnnotation -func (LoadBalancerAnnotation) Mixin() []ent.Mixin { - return []ent.Mixin{ - entx.NewTimestampMixin(), - } -} - -// Fields of the LoadBalancerAnnotation. -func (LoadBalancerAnnotation) Fields() []ent.Field { - return []ent.Field{ - field.String("id"). - GoType(gidx.PrefixedID("")). - DefaultFunc(func() gidx.PrefixedID { return gidx.MustNewID(LoadBalancerAnnotationPrefix) }). - Unique(). - Immutable(), - field.String("load_balancer_id"). - GoType(gidx.PrefixedID("")). - Immutable(). - Annotations( - entgql.Type("ID"), - entgql.Skip(entgql.SkipWhereInput, entgql.SkipMutationUpdateInput), - ), - } -} - -// Indexes of the LoadBalancerAnnotation -func (LoadBalancerAnnotation) Indexes() []ent.Index { - return []ent.Index{ - index.Fields("load_balancer_id"), - } -} - -// Edges of the LoadBalancerAnnotation -func (LoadBalancerAnnotation) Edges() []ent.Edge { - return []ent.Edge{ - edge.To("load_balancer", LoadBalancer.Type). - Unique(). - Required(). - Immutable(). - Field("load_balancer_id"). - Annotations(), - } -} - -// Annotations for the LoadBalancerAnnotation -func (LoadBalancerAnnotation) Annotations() []schema.Annotation { - return []schema.Annotation{ - entx.GraphKeyDirective("id"), - entgql.RelayConnection(), - } -} diff --git a/internal/ent/schema/lb_status.go b/internal/ent/schema/lb_status.go deleted file mode 100644 index 7f27317ac..000000000 --- a/internal/ent/schema/lb_status.go +++ /dev/null @@ -1,76 +0,0 @@ -package schema - -import ( - "entgo.io/contrib/entgql" - "entgo.io/ent" - "entgo.io/ent/schema" - "entgo.io/ent/schema/edge" - "entgo.io/ent/schema/field" - "entgo.io/ent/schema/index" - "go.infratographer.com/x/entx" - "go.infratographer.com/x/gidx" -) - -// LoadBalancerStatus holds the schema definition for the LoadBalancerStatus entity. -type LoadBalancerStatus struct { - ent.Schema -} - -// Mixin of the LoadBalancerStatus -func (LoadBalancerStatus) Mixin() []ent.Mixin { - return []ent.Mixin{ - entx.NewTimestampMixin(), - } -} - -// Fields of the LoadBalancerStatus. -func (LoadBalancerStatus) Fields() []ent.Field { - return []ent.Field{ - field.String("id"). - GoType(gidx.PrefixedID("")). - DefaultFunc(func() gidx.PrefixedID { return gidx.MustNewID(LoadBalancerStatusPrefix) }). - Unique(). - Immutable(), - field.String("load_balancer_id"). - GoType(gidx.PrefixedID("")). - Immutable(). - Annotations( - entgql.Type("ID"), - entgql.Skip(entgql.SkipWhereInput, entgql.SkipMutationUpdateInput), - ), - field.String("source"). - Immutable(). - NotEmpty(). - Annotations( - entgql.Skip(entgql.SkipMutationUpdateInput), - ), - } -} - -// Indexes of the LoadBalancerStatus -func (LoadBalancerStatus) Indexes() []ent.Index { - return []ent.Index{ - index.Fields("load_balancer_id"), - index.Fields("load_balancer_id", "source"), - } -} - -// Edges of the LoadBalancerStatus -func (LoadBalancerStatus) Edges() []ent.Edge { - return []ent.Edge{ - edge.To("load_balancer", LoadBalancer.Type). - Unique(). - Required(). - Immutable(). - Field("load_balancer_id"). - Annotations(), - } -} - -// Annotations for the LoadBalancerStatus -func (LoadBalancerStatus) Annotations() []schema.Annotation { - return []schema.Annotation{ - entx.GraphKeyDirective("id"), - entgql.RelayConnection(), - } -} diff --git a/internal/ent/schema/loadbalancer.go b/internal/ent/schema/loadbalancer.go index ec7b9e7a4..7bf49c408 100644 --- a/internal/ent/schema/loadbalancer.go +++ b/internal/ent/schema/loadbalancer.go @@ -7,6 +7,7 @@ import ( "entgo.io/ent/schema/edge" "entgo.io/ent/schema/field" "entgo.io/ent/schema/index" + "github.com/vektah/gqlparser/v2/ast" "go.infratographer.com/x/entx" "go.infratographer.com/x/gidx" @@ -82,20 +83,6 @@ func (LoadBalancer) Fields() []ent.Field { // Edges of the Instance. func (LoadBalancer) Edges() []ent.Edge { return []ent.Edge{ - edge.From("annotations", LoadBalancerAnnotation.Type). - Ref("load_balancer"). - Comment("Annotations for the load balancer."). - Annotations( - entgql.RelayConnection(), - entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput), - ), - edge.From("statuses", LoadBalancerStatus.Type). - Ref("load_balancer"). - Comment("Statuses for the load balancer."). - Annotations( - entgql.RelayConnection(), - entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput), - ), edge.From("ports", Port.Type). Ref("load_balancer"). Annotations( @@ -128,7 +115,8 @@ func (LoadBalancer) Annotations() []schema.Annotation { entx.GraphKeyDirective("id"), pubsubinfo.Annotation{}, schema.Comment("Representation of a load balancer."), - entgql.Implements("IPv4Addressable"), + prefixIDDirective(LoadBalancerPrefix), + entgql.Implements("IPAddressable"), entgql.RelayConnection(), entgql.Mutations( entgql.MutationCreate().Description("Input information to create a load balancer."), @@ -136,3 +124,18 @@ func (LoadBalancer) Annotations() []schema.Annotation { ), } } + +func prefixIDDirective(prefix string) entgql.Annotation { + var args []*ast.Argument + if prefix != "" { + args = append(args, &ast.Argument{ + Name: "prefix", + Value: &ast.Value{ + Raw: prefix, + Kind: ast.StringValue, + }, + }) + } + + return entgql.Directives(entgql.NewDirective("prefixedID", args...)) +} diff --git a/internal/ent/schema/origin.go b/internal/ent/schema/origin.go index 7157061ff..dec519b10 100644 --- a/internal/ent/schema/origin.go +++ b/internal/ent/schema/origin.go @@ -89,6 +89,7 @@ func (Origin) Annotations() []schema.Annotation { return []schema.Annotation{ entx.GraphKeyDirective("id"), entgql.Type("LoadBalancerOrigin"), + prefixIDDirective(OriginPrefix), entgql.RelayConnection(), entgql.Mutations(entgql.MutationCreate(), entgql.MutationUpdate()), } diff --git a/internal/ent/schema/pool.go b/internal/ent/schema/pool.go index 685f05cd5..76c0cc19f 100644 --- a/internal/ent/schema/pool.go +++ b/internal/ent/schema/pool.go @@ -77,6 +77,7 @@ func (Pool) Annotations() []schema.Annotation { return []schema.Annotation{ entx.GraphKeyDirective("id"), entgql.Type("LoadBalancerPool"), + prefixIDDirective(PoolPrefix), entgql.RelayConnection(), entgql.QueryField(), entgql.Mutations(entgql.MutationCreate(), entgql.MutationUpdate()), diff --git a/internal/ent/schema/port.go b/internal/ent/schema/port.go index f07e2eb1f..288cdbefe 100644 --- a/internal/ent/schema/port.go +++ b/internal/ent/schema/port.go @@ -88,6 +88,7 @@ func (Port) Annotations() []schema.Annotation { return []schema.Annotation{ entx.GraphKeyDirective("id"), entgql.Type("LoadBalancerPort"), + prefixIDDirective(PortPrefix), entgql.RelayConnection(), entgql.Mutations(entgql.MutationCreate(), entgql.MutationUpdate()), pubsubinfo.Annotation{}, diff --git a/internal/ent/schema/provider.go b/internal/ent/schema/provider.go index 5efabd578..3d74b2d3d 100644 --- a/internal/ent/schema/provider.go +++ b/internal/ent/schema/provider.go @@ -79,6 +79,7 @@ func (Provider) Annotations() []schema.Annotation { entx.GraphKeyDirective("id"), schema.Comment("Representation of a load balancer provider. Load balancer providers are responsible for provisioning and managing load balancers"), entgql.Type("LoadBalancerProvider"), + prefixIDDirective(LoadBalancerProviderPrefix), entgql.RelayConnection(), entgql.Mutations( entgql.MutationCreate().Description("Input information to create a load balancer provider."), diff --git a/internal/ent/templates/ip_addressable.tmpl b/internal/ent/templates/ip_addressable.tmpl index 7a8f1fc38..c318553ed 100644 --- a/internal/ent/templates/ip_addressable.tmpl +++ b/internal/ent/templates/ip_addressable.tmpl @@ -1,7 +1,7 @@ {{ define "model/additional/ip_addressable" }} {{- if eq $.Name "LoadBalancer" }} - // IsIPv4Addressable implements interface for IPv4Addressable - func ({{ $.Receiver }} {{ $.Name }}) IsIPv4Addressable() {} + // IsIPAddressable implements interface for IPAddressable + func ({{ $.Receiver }} {{ $.Name }}) IsIPAddressable() {} {{ end }} {{ end }} @@ -9,12 +9,7 @@ {{ $pkg := base $.Config.Package }} {{ template "header" $ }} -type IPv4Addressable interface { - - IsIPv4Addressable() -} - -type IPv6Addressable interface { - IsIPv6Addressable() +type IPAddressable interface { + IsIPAddressable() } {{ end }} diff --git a/internal/graphapi/ent.resolvers.go b/internal/graphapi/ent.resolvers.go index 3c417f790..4d7bc23e8 100644 --- a/internal/graphapi/ent.resolvers.go +++ b/internal/graphapi/ent.resolvers.go @@ -2,7 +2,7 @@ package graphapi // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.31 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" diff --git a/internal/graphapi/entity.resolvers.go b/internal/graphapi/entity.resolvers.go index 9b1eb2944..06e63d57d 100644 --- a/internal/graphapi/entity.resolvers.go +++ b/internal/graphapi/entity.resolvers.go @@ -2,7 +2,7 @@ package graphapi // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.31 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" @@ -16,11 +16,6 @@ func (r *entityResolver) FindLoadBalancerByID(ctx context.Context, id gidx.Prefi return r.client.LoadBalancer.Get(ctx, id) } -// FindLoadBalancerAnnotationByID is the resolver for the findLoadBalancerAnnotationByID field. -func (r *entityResolver) FindLoadBalancerAnnotationByID(ctx context.Context, id gidx.PrefixedID) (*generated.LoadBalancerAnnotation, error) { - return r.client.LoadBalancerAnnotation.Get(ctx, id) -} - // FindLoadBalancerOriginByID is the resolver for the findLoadBalancerOriginByID field. func (r *entityResolver) FindLoadBalancerOriginByID(ctx context.Context, id gidx.PrefixedID) (*generated.Origin, error) { return r.client.Origin.Get(ctx, id) @@ -41,19 +36,14 @@ func (r *entityResolver) FindLoadBalancerProviderByID(ctx context.Context, id gi return r.client.Provider.Get(ctx, id) } -// FindLoadBalancerStatusByID is the resolver for the findLoadBalancerStatusByID field. -func (r *entityResolver) FindLoadBalancerStatusByID(ctx context.Context, id gidx.PrefixedID) (*generated.LoadBalancerStatus, error) { - return r.client.LoadBalancerStatus.Get(ctx, id) -} - // FindLocationByID is the resolver for the findLocationByID field. func (r *entityResolver) FindLocationByID(ctx context.Context, id gidx.PrefixedID) (*Location, error) { return &Location{ID: id}, nil } -// FindOwnerByID is the resolver for the findOwnerByID field. -func (r *entityResolver) FindOwnerByID(ctx context.Context, id gidx.PrefixedID) (*Owner, error) { - return &Owner{ID: id}, nil +// FindResourceOwnerByID is the resolver for the findResourceOwnerByID field. +func (r *entityResolver) FindResourceOwnerByID(ctx context.Context, id gidx.PrefixedID) (*ResourceOwner, error) { + return &ResourceOwner{ID: id}, nil } // Entity returns EntityResolver implementation. diff --git a/internal/graphapi/gen_federation.go b/internal/graphapi/gen_federation.go index e066231b5..a42cfe28e 100644 --- a/internal/graphapi/gen_federation.go +++ b/internal/graphapi/gen_federation.go @@ -97,26 +97,6 @@ func (ec *executionContext) __resolve_entities(ctx context.Context, representati return fmt.Errorf(`resolving Entity "LoadBalancer": %w`, err) } - list[idx[i]] = entity - return nil - } - case "LoadBalancerAnnotation": - resolverName, err := entityResolverNameForLoadBalancerAnnotation(ctx, rep) - if err != nil { - return fmt.Errorf(`finding resolver for Entity "LoadBalancerAnnotation": %w`, err) - } - switch resolverName { - - case "findLoadBalancerAnnotationByID": - id0, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, rep["id"]) - if err != nil { - return fmt.Errorf(`unmarshalling param 0 for findLoadBalancerAnnotationByID(): %w`, err) - } - entity, err := ec.resolvers.Entity().FindLoadBalancerAnnotationByID(ctx, id0) - if err != nil { - return fmt.Errorf(`resolving Entity "LoadBalancerAnnotation": %w`, err) - } - list[idx[i]] = entity return nil } @@ -197,26 +177,6 @@ func (ec *executionContext) __resolve_entities(ctx context.Context, representati return fmt.Errorf(`resolving Entity "LoadBalancerProvider": %w`, err) } - list[idx[i]] = entity - return nil - } - case "LoadBalancerStatus": - resolverName, err := entityResolverNameForLoadBalancerStatus(ctx, rep) - if err != nil { - return fmt.Errorf(`finding resolver for Entity "LoadBalancerStatus": %w`, err) - } - switch resolverName { - - case "findLoadBalancerStatusByID": - id0, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, rep["id"]) - if err != nil { - return fmt.Errorf(`unmarshalling param 0 for findLoadBalancerStatusByID(): %w`, err) - } - entity, err := ec.resolvers.Entity().FindLoadBalancerStatusByID(ctx, id0) - if err != nil { - return fmt.Errorf(`resolving Entity "LoadBalancerStatus": %w`, err) - } - list[idx[i]] = entity return nil } @@ -240,21 +200,21 @@ func (ec *executionContext) __resolve_entities(ctx context.Context, representati list[idx[i]] = entity return nil } - case "Owner": - resolverName, err := entityResolverNameForOwner(ctx, rep) + case "ResourceOwner": + resolverName, err := entityResolverNameForResourceOwner(ctx, rep) if err != nil { - return fmt.Errorf(`finding resolver for Entity "Owner": %w`, err) + return fmt.Errorf(`finding resolver for Entity "ResourceOwner": %w`, err) } switch resolverName { - case "findOwnerByID": + case "findResourceOwnerByID": id0, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, rep["id"]) if err != nil { - return fmt.Errorf(`unmarshalling param 0 for findOwnerByID(): %w`, err) + return fmt.Errorf(`unmarshalling param 0 for findResourceOwnerByID(): %w`, err) } - entity, err := ec.resolvers.Entity().FindOwnerByID(ctx, id0) + entity, err := ec.resolvers.Entity().FindResourceOwnerByID(ctx, id0) if err != nil { - return fmt.Errorf(`resolving Entity "Owner": %w`, err) + return fmt.Errorf(`resolving Entity "ResourceOwner": %w`, err) } list[idx[i]] = entity @@ -346,23 +306,6 @@ func entityResolverNameForLoadBalancer(ctx context.Context, rep map[string]inter return "", fmt.Errorf("%w for LoadBalancer", ErrTypeNotFound) } -func entityResolverNameForLoadBalancerAnnotation(ctx context.Context, rep map[string]interface{}) (string, error) { - for { - var ( - m map[string]interface{} - val interface{} - ok bool - ) - _ = val - m = rep - if _, ok = m["id"]; !ok { - break - } - return "findLoadBalancerAnnotationByID", nil - } - return "", fmt.Errorf("%w for LoadBalancerAnnotation", ErrTypeNotFound) -} - func entityResolverNameForLoadBalancerOrigin(ctx context.Context, rep map[string]interface{}) (string, error) { for { var ( @@ -431,23 +374,6 @@ func entityResolverNameForLoadBalancerProvider(ctx context.Context, rep map[stri return "", fmt.Errorf("%w for LoadBalancerProvider", ErrTypeNotFound) } -func entityResolverNameForLoadBalancerStatus(ctx context.Context, rep map[string]interface{}) (string, error) { - for { - var ( - m map[string]interface{} - val interface{} - ok bool - ) - _ = val - m = rep - if _, ok = m["id"]; !ok { - break - } - return "findLoadBalancerStatusByID", nil - } - return "", fmt.Errorf("%w for LoadBalancerStatus", ErrTypeNotFound) -} - func entityResolverNameForLocation(ctx context.Context, rep map[string]interface{}) (string, error) { for { var ( @@ -465,7 +391,7 @@ func entityResolverNameForLocation(ctx context.Context, rep map[string]interface return "", fmt.Errorf("%w for Location", ErrTypeNotFound) } -func entityResolverNameForOwner(ctx context.Context, rep map[string]interface{}) (string, error) { +func entityResolverNameForResourceOwner(ctx context.Context, rep map[string]interface{}) (string, error) { for { var ( m map[string]interface{} @@ -477,7 +403,7 @@ func entityResolverNameForOwner(ctx context.Context, rep map[string]interface{}) if _, ok = m["id"]; !ok { break } - return "findOwnerByID", nil + return "findResourceOwnerByID", nil } - return "", fmt.Errorf("%w for Owner", ErrTypeNotFound) + return "", fmt.Errorf("%w for ResourceOwner", ErrTypeNotFound) } diff --git a/internal/graphapi/gen_models.go b/internal/graphapi/gen_models.go index 6afbcb97c..c94e44157 100644 --- a/internal/graphapi/gen_models.go +++ b/internal/graphapi/gen_models.go @@ -96,3 +96,12 @@ type LoadBalancerUpdatePayload struct { // The updated load balancer. LoadBalancer *generated.LoadBalancer `json:"loadBalancer"` } + +type ResourceOwner struct { + ID gidx.PrefixedID `json:"id"` + LoadBalancers *generated.LoadBalancerConnection `json:"loadBalancers"` + LoadBalancerPools *generated.LoadBalancerPoolConnection `json:"loadBalancerPools"` + LoadBalancersProviders *generated.LoadBalancerProviderConnection `json:"loadBalancersProviders"` +} + +func (ResourceOwner) IsEntity() {} diff --git a/internal/graphapi/gen_server.go b/internal/graphapi/gen_server.go index fc0cd3719..07a2e519b 100644 --- a/internal/graphapi/gen_server.go +++ b/internal/graphapi/gen_server.go @@ -47,56 +47,34 @@ type ResolverRoot interface { LoadBalancerProvider() LoadBalancerProviderResolver Location() LocationResolver Mutation() MutationResolver - Owner() OwnerResolver Query() QueryResolver + ResourceOwner() ResourceOwnerResolver } type DirectiveRoot struct { + ComposeDirective func(ctx context.Context, obj interface{}, next graphql.Resolver, name string) (res interface{}, err error) } type ComplexityRoot struct { Entity struct { - FindLoadBalancerAnnotationByID func(childComplexity int, id gidx.PrefixedID) int - FindLoadBalancerByID func(childComplexity int, id gidx.PrefixedID) int - FindLoadBalancerOriginByID func(childComplexity int, id gidx.PrefixedID) int - FindLoadBalancerPoolByID func(childComplexity int, id gidx.PrefixedID) int - FindLoadBalancerPortByID func(childComplexity int, id gidx.PrefixedID) int - FindLoadBalancerProviderByID func(childComplexity int, id gidx.PrefixedID) int - FindLoadBalancerStatusByID func(childComplexity int, id gidx.PrefixedID) int - FindLocationByID func(childComplexity int, id gidx.PrefixedID) int - FindOwnerByID func(childComplexity int, id gidx.PrefixedID) int + FindLoadBalancerByID func(childComplexity int, id gidx.PrefixedID) int + FindLoadBalancerOriginByID func(childComplexity int, id gidx.PrefixedID) int + FindLoadBalancerPoolByID func(childComplexity int, id gidx.PrefixedID) int + FindLoadBalancerPortByID func(childComplexity int, id gidx.PrefixedID) int + FindLoadBalancerProviderByID func(childComplexity int, id gidx.PrefixedID) int + FindLocationByID func(childComplexity int, id gidx.PrefixedID) int + FindResourceOwnerByID func(childComplexity int, id gidx.PrefixedID) int } LoadBalancer struct { - Annotations func(childComplexity int, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerAnnotationOrder, where *generated.LoadBalancerAnnotationWhereInput) int - CreatedAt func(childComplexity int) int - ID func(childComplexity int) int - Location func(childComplexity int) int - Name func(childComplexity int) int - Owner func(childComplexity int) int - 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 - Statuses func(childComplexity int, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerStatusOrder, where *generated.LoadBalancerStatusWhereInput) int - UpdatedAt func(childComplexity int) int - } - - LoadBalancerAnnotation struct { - CreatedAt func(childComplexity int) int - ID func(childComplexity int) int - LoadBalancer func(childComplexity int) int - LoadBalancerID func(childComplexity int) int - UpdatedAt func(childComplexity int) int - } - - LoadBalancerAnnotationConnection struct { - Edges func(childComplexity int) int - PageInfo func(childComplexity int) int - TotalCount func(childComplexity int) int - } - - LoadBalancerAnnotationEdge struct { - Cursor func(childComplexity int) int - Node func(childComplexity int) int + CreatedAt func(childComplexity int) int + ID func(childComplexity int) int + Location func(childComplexity int) int + Name func(childComplexity int) int + Owner func(childComplexity int) int + 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 } LoadBalancerConnection struct { @@ -254,26 +232,6 @@ type ComplexityRoot struct { LoadBalancerProvider func(childComplexity int) int } - LoadBalancerStatus struct { - CreatedAt func(childComplexity int) int - ID func(childComplexity int) int - LoadBalancer func(childComplexity int) int - LoadBalancerID func(childComplexity int) int - Source func(childComplexity int) int - UpdatedAt func(childComplexity int) int - } - - LoadBalancerStatusConnection struct { - Edges func(childComplexity int) int - PageInfo func(childComplexity int) int - TotalCount func(childComplexity int) int - } - - LoadBalancerStatusEdge struct { - Cursor func(childComplexity int) int - Node func(childComplexity int) int - } - LoadBalancerUpdatePayload struct { LoadBalancer func(childComplexity int) int } @@ -301,13 +259,6 @@ type ComplexityRoot struct { LoadBalancerUpdate func(childComplexity int, id gidx.PrefixedID, input generated.UpdateLoadBalancerInput) int } - Owner struct { - ID func(childComplexity int) int - LoadBalancerPools func(childComplexity int, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerPoolOrder, where *generated.LoadBalancerPoolWhereInput) 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 - LoadBalancersProviders func(childComplexity int, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerProviderWhereInput) int - } - PageInfo struct { EndCursor func(childComplexity int) int HasNextPage func(childComplexity int) int @@ -324,6 +275,13 @@ type ComplexityRoot struct { __resolve_entities func(childComplexity int, representations []map[string]interface{}) int } + ResourceOwner struct { + ID func(childComplexity int) int + LoadBalancerPools func(childComplexity int, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerPoolOrder, where *generated.LoadBalancerPoolWhereInput) 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 + LoadBalancersProviders func(childComplexity int, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerProviderWhereInput) int + } + _Service struct { SDL func(childComplexity int) int } @@ -331,35 +289,33 @@ type ComplexityRoot struct { type EntityResolver interface { FindLoadBalancerByID(ctx context.Context, id gidx.PrefixedID) (*generated.LoadBalancer, error) - FindLoadBalancerAnnotationByID(ctx context.Context, id gidx.PrefixedID) (*generated.LoadBalancerAnnotation, error) FindLoadBalancerOriginByID(ctx context.Context, id gidx.PrefixedID) (*generated.Origin, error) FindLoadBalancerPoolByID(ctx context.Context, id gidx.PrefixedID) (*generated.Pool, error) FindLoadBalancerPortByID(ctx context.Context, id gidx.PrefixedID) (*generated.Port, error) FindLoadBalancerProviderByID(ctx context.Context, id gidx.PrefixedID) (*generated.Provider, error) - FindLoadBalancerStatusByID(ctx context.Context, id gidx.PrefixedID) (*generated.LoadBalancerStatus, error) FindLocationByID(ctx context.Context, id gidx.PrefixedID) (*Location, error) - FindOwnerByID(ctx context.Context, id gidx.PrefixedID) (*Owner, error) + FindResourceOwnerByID(ctx context.Context, id gidx.PrefixedID) (*ResourceOwner, error) } type LoadBalancerResolver interface { Location(ctx context.Context, obj *generated.LoadBalancer) (*Location, error) - Owner(ctx context.Context, obj *generated.LoadBalancer) (*Owner, error) + Owner(ctx context.Context, obj *generated.LoadBalancer) (*ResourceOwner, error) } type LoadBalancerPoolResolver interface { - Owner(ctx context.Context, obj *generated.Pool) (*Owner, error) + Owner(ctx context.Context, obj *generated.Pool) (*ResourceOwner, error) } type LoadBalancerProviderResolver interface { - Owner(ctx context.Context, obj *generated.Provider) (*Owner, error) + Owner(ctx context.Context, obj *generated.Provider) (*ResourceOwner, error) } type LocationResolver interface { LoadBalancers(ctx context.Context, obj *Location, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerWhereInput) (*generated.LoadBalancerConnection, error) } type MutationResolver interface { - LoadBalancerCreate(ctx context.Context, input generated.CreateLoadBalancerInput) (*LoadBalancerCreatePayload, error) - LoadBalancerUpdate(ctx context.Context, id gidx.PrefixedID, input generated.UpdateLoadBalancerInput) (*LoadBalancerUpdatePayload, error) - LoadBalancerDelete(ctx context.Context, id gidx.PrefixedID) (*LoadBalancerDeletePayload, error) LoadBalancerOriginCreate(ctx context.Context, input generated.CreateLoadBalancerOriginInput) (*LoadBalancerOriginCreatePayload, error) LoadBalancerOriginUpdate(ctx context.Context, id gidx.PrefixedID, input generated.UpdateLoadBalancerOriginInput) (*LoadBalancerOriginUpdatePayload, error) LoadBalancerOriginDelete(ctx context.Context, id gidx.PrefixedID) (*LoadBalancerOriginDeletePayload, error) + LoadBalancerCreate(ctx context.Context, input generated.CreateLoadBalancerInput) (*LoadBalancerCreatePayload, error) + LoadBalancerUpdate(ctx context.Context, id gidx.PrefixedID, input generated.UpdateLoadBalancerInput) (*LoadBalancerUpdatePayload, error) + LoadBalancerDelete(ctx context.Context, id gidx.PrefixedID) (*LoadBalancerDeletePayload, error) LoadBalancerPoolCreate(ctx context.Context, input generated.CreateLoadBalancerPoolInput) (*LoadBalancerPoolCreatePayload, error) LoadBalancerPoolUpdate(ctx context.Context, id gidx.PrefixedID, input generated.UpdateLoadBalancerPoolInput) (*LoadBalancerPoolUpdatePayload, error) LoadBalancerPoolDelete(ctx context.Context, id gidx.PrefixedID) (*LoadBalancerPoolDeletePayload, error) @@ -370,17 +326,17 @@ type MutationResolver interface { LoadBalancerProviderUpdate(ctx context.Context, id gidx.PrefixedID, input generated.UpdateLoadBalancerProviderInput) (*LoadBalancerProviderUpdatePayload, error) LoadBalancerProviderDelete(ctx context.Context, id gidx.PrefixedID) (*LoadBalancerProviderDeletePayload, error) } -type OwnerResolver interface { - LoadBalancers(ctx context.Context, obj *Owner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerWhereInput) (*generated.LoadBalancerConnection, error) - LoadBalancerPools(ctx context.Context, obj *Owner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerPoolOrder, where *generated.LoadBalancerPoolWhereInput) (*generated.LoadBalancerPoolConnection, error) - LoadBalancersProviders(ctx context.Context, obj *Owner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerProviderWhereInput) (*generated.LoadBalancerProviderConnection, error) -} type QueryResolver interface { LoadBalancerPools(ctx context.Context, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerPoolOrder, where *generated.LoadBalancerPoolWhereInput) (*generated.LoadBalancerPoolConnection, error) LoadBalancer(ctx context.Context, id gidx.PrefixedID) (*generated.LoadBalancer, error) LoadBalancerPool(ctx context.Context, id gidx.PrefixedID) (*generated.Pool, error) LoadBalancerProvider(ctx context.Context, id gidx.PrefixedID) (*generated.Provider, error) } +type ResourceOwnerResolver interface { + LoadBalancers(ctx context.Context, obj *ResourceOwner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerWhereInput) (*generated.LoadBalancerConnection, error) + LoadBalancerPools(ctx context.Context, obj *ResourceOwner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerPoolOrder, where *generated.LoadBalancerPoolWhereInput) (*generated.LoadBalancerPoolConnection, error) + LoadBalancersProviders(ctx context.Context, obj *ResourceOwner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerProviderWhereInput) (*generated.LoadBalancerProviderConnection, error) +} type executableSchema struct { resolvers ResolverRoot @@ -393,22 +349,10 @@ func (e *executableSchema) Schema() *ast.Schema { } func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { - ec := executionContext{nil, e} + ec := executionContext{nil, e, 0, 0, nil} _ = ec switch typeName + "." + field { - case "Entity.findLoadBalancerAnnotationByID": - if e.complexity.Entity.FindLoadBalancerAnnotationByID == nil { - break - } - - args, err := ec.field_Entity_findLoadBalancerAnnotationByID_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Entity.FindLoadBalancerAnnotationByID(childComplexity, args["id"].(gidx.PrefixedID)), true - case "Entity.findLoadBalancerByID": if e.complexity.Entity.FindLoadBalancerByID == nil { break @@ -469,18 +413,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Entity.FindLoadBalancerProviderByID(childComplexity, args["id"].(gidx.PrefixedID)), true - case "Entity.findLoadBalancerStatusByID": - if e.complexity.Entity.FindLoadBalancerStatusByID == nil { - break - } - - args, err := ec.field_Entity_findLoadBalancerStatusByID_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Entity.FindLoadBalancerStatusByID(childComplexity, args["id"].(gidx.PrefixedID)), true - case "Entity.findLocationByID": if e.complexity.Entity.FindLocationByID == nil { break @@ -493,29 +425,17 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Entity.FindLocationByID(childComplexity, args["id"].(gidx.PrefixedID)), true - case "Entity.findOwnerByID": - if e.complexity.Entity.FindOwnerByID == nil { - break - } - - args, err := ec.field_Entity_findOwnerByID_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Entity.FindOwnerByID(childComplexity, args["id"].(gidx.PrefixedID)), true - - case "LoadBalancer.annotations": - if e.complexity.LoadBalancer.Annotations == nil { + case "Entity.findResourceOwnerByID": + if e.complexity.Entity.FindResourceOwnerByID == nil { break } - args, err := ec.field_LoadBalancer_annotations_args(context.TODO(), rawArgs) + args, err := ec.field_Entity_findResourceOwnerByID_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.LoadBalancer.Annotations(childComplexity, args["after"].(*entgql.Cursor[gidx.PrefixedID]), args["first"].(*int), args["before"].(*entgql.Cursor[gidx.PrefixedID]), args["last"].(*int), args["orderBy"].(*generated.LoadBalancerAnnotationOrder), args["where"].(*generated.LoadBalancerAnnotationWhereInput)), true + return e.complexity.Entity.FindResourceOwnerByID(childComplexity, args["id"].(gidx.PrefixedID)), true case "LoadBalancer.createdAt": if e.complexity.LoadBalancer.CreatedAt == nil { @@ -571,18 +491,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancer.Provider(childComplexity), true - case "LoadBalancer.statuses": - if e.complexity.LoadBalancer.Statuses == nil { - break - } - - args, err := ec.field_LoadBalancer_statuses_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.LoadBalancer.Statuses(childComplexity, args["after"].(*entgql.Cursor[gidx.PrefixedID]), args["first"].(*int), args["before"].(*entgql.Cursor[gidx.PrefixedID]), args["last"].(*int), args["orderBy"].(*generated.LoadBalancerStatusOrder), args["where"].(*generated.LoadBalancerStatusWhereInput)), true - case "LoadBalancer.updatedAt": if e.complexity.LoadBalancer.UpdatedAt == nil { break @@ -590,76 +498,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancer.UpdatedAt(childComplexity), true - case "LoadBalancerAnnotation.createdAt": - if e.complexity.LoadBalancerAnnotation.CreatedAt == nil { - break - } - - return e.complexity.LoadBalancerAnnotation.CreatedAt(childComplexity), true - - case "LoadBalancerAnnotation.id": - if e.complexity.LoadBalancerAnnotation.ID == nil { - break - } - - return e.complexity.LoadBalancerAnnotation.ID(childComplexity), true - - case "LoadBalancerAnnotation.loadBalancer": - if e.complexity.LoadBalancerAnnotation.LoadBalancer == nil { - break - } - - return e.complexity.LoadBalancerAnnotation.LoadBalancer(childComplexity), true - - case "LoadBalancerAnnotation.loadBalancerID": - if e.complexity.LoadBalancerAnnotation.LoadBalancerID == nil { - break - } - - return e.complexity.LoadBalancerAnnotation.LoadBalancerID(childComplexity), true - - case "LoadBalancerAnnotation.updatedAt": - if e.complexity.LoadBalancerAnnotation.UpdatedAt == nil { - break - } - - return e.complexity.LoadBalancerAnnotation.UpdatedAt(childComplexity), true - - case "LoadBalancerAnnotationConnection.edges": - if e.complexity.LoadBalancerAnnotationConnection.Edges == nil { - break - } - - return e.complexity.LoadBalancerAnnotationConnection.Edges(childComplexity), true - - case "LoadBalancerAnnotationConnection.pageInfo": - if e.complexity.LoadBalancerAnnotationConnection.PageInfo == nil { - break - } - - return e.complexity.LoadBalancerAnnotationConnection.PageInfo(childComplexity), true - - case "LoadBalancerAnnotationConnection.totalCount": - if e.complexity.LoadBalancerAnnotationConnection.TotalCount == nil { - break - } - - return e.complexity.LoadBalancerAnnotationConnection.TotalCount(childComplexity), true - - case "LoadBalancerAnnotationEdge.cursor": - if e.complexity.LoadBalancerAnnotationEdge.Cursor == nil { - break - } - - return e.complexity.LoadBalancerAnnotationEdge.Cursor(childComplexity), true - - case "LoadBalancerAnnotationEdge.node": - if e.complexity.LoadBalancerAnnotationEdge.Node == nil { - break - } - - return e.complexity.LoadBalancerAnnotationEdge.Node(childComplexity), true - case "LoadBalancerConnection.edges": if e.complexity.LoadBalancerConnection.Edges == nil { break @@ -1167,83 +1005,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LoadBalancerProviderUpdatePayload.LoadBalancerProvider(childComplexity), true - case "LoadBalancerStatus.createdAt": - if e.complexity.LoadBalancerStatus.CreatedAt == nil { - break - } - - return e.complexity.LoadBalancerStatus.CreatedAt(childComplexity), true - - case "LoadBalancerStatus.id": - if e.complexity.LoadBalancerStatus.ID == nil { - break - } - - return e.complexity.LoadBalancerStatus.ID(childComplexity), true - - case "LoadBalancerStatus.loadBalancer": - if e.complexity.LoadBalancerStatus.LoadBalancer == nil { - break - } - - return e.complexity.LoadBalancerStatus.LoadBalancer(childComplexity), true - - case "LoadBalancerStatus.loadBalancerID": - if e.complexity.LoadBalancerStatus.LoadBalancerID == nil { - break - } - - return e.complexity.LoadBalancerStatus.LoadBalancerID(childComplexity), true - - case "LoadBalancerStatus.source": - if e.complexity.LoadBalancerStatus.Source == nil { - break - } - - return e.complexity.LoadBalancerStatus.Source(childComplexity), true - - case "LoadBalancerStatus.updatedAt": - if e.complexity.LoadBalancerStatus.UpdatedAt == nil { - break - } - - return e.complexity.LoadBalancerStatus.UpdatedAt(childComplexity), true - - case "LoadBalancerStatusConnection.edges": - if e.complexity.LoadBalancerStatusConnection.Edges == nil { - break - } - - return e.complexity.LoadBalancerStatusConnection.Edges(childComplexity), true - - case "LoadBalancerStatusConnection.pageInfo": - if e.complexity.LoadBalancerStatusConnection.PageInfo == nil { - break - } - - return e.complexity.LoadBalancerStatusConnection.PageInfo(childComplexity), true - - case "LoadBalancerStatusConnection.totalCount": - if e.complexity.LoadBalancerStatusConnection.TotalCount == nil { - break - } - - return e.complexity.LoadBalancerStatusConnection.TotalCount(childComplexity), true - - case "LoadBalancerStatusEdge.cursor": - if e.complexity.LoadBalancerStatusEdge.Cursor == nil { - break - } - - return e.complexity.LoadBalancerStatusEdge.Cursor(childComplexity), true - - case "LoadBalancerStatusEdge.node": - if e.complexity.LoadBalancerStatusEdge.Node == nil { - break - } - - return e.complexity.LoadBalancerStatusEdge.Node(childComplexity), true - case "LoadBalancerUpdatePayload.loadBalancer": if e.complexity.LoadBalancerUpdatePayload.LoadBalancer == nil { break @@ -1450,49 +1211,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.LoadBalancerUpdate(childComplexity, args["id"].(gidx.PrefixedID), args["input"].(generated.UpdateLoadBalancerInput)), true - case "Owner.id": - if e.complexity.Owner.ID == nil { - break - } - - return e.complexity.Owner.ID(childComplexity), true - - case "Owner.loadBalancerPools": - if e.complexity.Owner.LoadBalancerPools == nil { - break - } - - args, err := ec.field_Owner_loadBalancerPools_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Owner.LoadBalancerPools(childComplexity, args["after"].(*entgql.Cursor[gidx.PrefixedID]), args["first"].(*int), args["before"].(*entgql.Cursor[gidx.PrefixedID]), args["last"].(*int), args["orderBy"].(*generated.LoadBalancerPoolOrder), args["where"].(*generated.LoadBalancerPoolWhereInput)), true - - case "Owner.loadBalancers": - if e.complexity.Owner.LoadBalancers == nil { - break - } - - args, err := ec.field_Owner_loadBalancers_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Owner.LoadBalancers(childComplexity, args["after"].(*entgql.Cursor[gidx.PrefixedID]), args["first"].(*int), args["before"].(*entgql.Cursor[gidx.PrefixedID]), args["last"].(*int), args["orderBy"].(*generated.LoadBalancerOrder), args["where"].(*generated.LoadBalancerWhereInput)), true - - case "Owner.loadBalancersProviders": - if e.complexity.Owner.LoadBalancersProviders == nil { - break - } - - args, err := ec.field_Owner_loadBalancersProviders_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Owner.LoadBalancersProviders(childComplexity, args["after"].(*entgql.Cursor[gidx.PrefixedID]), args["first"].(*int), args["before"].(*entgql.Cursor[gidx.PrefixedID]), args["last"].(*int), args["orderBy"].(*generated.LoadBalancerOrder), args["where"].(*generated.LoadBalancerProviderWhereInput)), true - case "PageInfo.endCursor": if e.complexity.PageInfo.EndCursor == nil { break @@ -1588,6 +1306,49 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]interface{})), true + case "ResourceOwner.id": + if e.complexity.ResourceOwner.ID == nil { + break + } + + return e.complexity.ResourceOwner.ID(childComplexity), true + + case "ResourceOwner.loadBalancerPools": + if e.complexity.ResourceOwner.LoadBalancerPools == nil { + break + } + + args, err := ec.field_ResourceOwner_loadBalancerPools_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.ResourceOwner.LoadBalancerPools(childComplexity, args["after"].(*entgql.Cursor[gidx.PrefixedID]), args["first"].(*int), args["before"].(*entgql.Cursor[gidx.PrefixedID]), args["last"].(*int), args["orderBy"].(*generated.LoadBalancerPoolOrder), args["where"].(*generated.LoadBalancerPoolWhereInput)), true + + case "ResourceOwner.loadBalancers": + if e.complexity.ResourceOwner.LoadBalancers == nil { + break + } + + args, err := ec.field_ResourceOwner_loadBalancers_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.ResourceOwner.LoadBalancers(childComplexity, args["after"].(*entgql.Cursor[gidx.PrefixedID]), args["first"].(*int), args["before"].(*entgql.Cursor[gidx.PrefixedID]), args["last"].(*int), args["orderBy"].(*generated.LoadBalancerOrder), args["where"].(*generated.LoadBalancerWhereInput)), true + + case "ResourceOwner.loadBalancersProviders": + if e.complexity.ResourceOwner.LoadBalancersProviders == nil { + break + } + + args, err := ec.field_ResourceOwner_loadBalancersProviders_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.ResourceOwner.LoadBalancersProviders(childComplexity, args["after"].(*entgql.Cursor[gidx.PrefixedID]), args["first"].(*int), args["before"].(*entgql.Cursor[gidx.PrefixedID]), args["last"].(*int), args["orderBy"].(*generated.LoadBalancerOrder), args["where"].(*generated.LoadBalancerProviderWhereInput)), true + case "_Service.sdl": if e.complexity._Service.SDL == nil { break @@ -1601,15 +1362,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { rc := graphql.GetOperationContext(ctx) - ec := executionContext{rc, e} + ec := executionContext{rc, e, 0, 0, make(chan graphql.DeferredResult)} inputUnmarshalMap := graphql.BuildUnmarshalerMap( ec.unmarshalInputCreateLoadBalancerInput, ec.unmarshalInputCreateLoadBalancerOriginInput, ec.unmarshalInputCreateLoadBalancerPoolInput, ec.unmarshalInputCreateLoadBalancerPortInput, ec.unmarshalInputCreateLoadBalancerProviderInput, - ec.unmarshalInputLoadBalancerAnnotationOrder, - ec.unmarshalInputLoadBalancerAnnotationWhereInput, ec.unmarshalInputLoadBalancerOrder, ec.unmarshalInputLoadBalancerOriginOrder, ec.unmarshalInputLoadBalancerOriginWhereInput, @@ -1619,8 +1378,6 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputLoadBalancerPortWhereInput, ec.unmarshalInputLoadBalancerProviderOrder, ec.unmarshalInputLoadBalancerProviderWhereInput, - ec.unmarshalInputLoadBalancerStatusOrder, - ec.unmarshalInputLoadBalancerStatusWhereInput, ec.unmarshalInputLoadBalancerWhereInput, ec.unmarshalInputUpdateLoadBalancerInput, ec.unmarshalInputUpdateLoadBalancerOriginInput, @@ -1633,18 +1390,33 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { switch rc.Operation.Operation { case ast.Query: return func(ctx context.Context) *graphql.Response { - if !first { - return nil + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, rc.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } } - first = false - ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) - data := ec._Query(ctx, rc.Operation.SelectionSet) var buf bytes.Buffer data.MarshalGQL(&buf) - - return &graphql.Response{ - Data: buf.Bytes(), + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext } + + return &response } case ast.Mutation: return func(ctx context.Context) *graphql.Response { @@ -1670,6 +1442,28 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { type executionContext struct { *graphql.OperationContext *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() } func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { @@ -1746,33 +1540,14 @@ https://relay.dev/graphql/connections.htm#sec-Cursor scalar Cursor """A valid JSON string.""" scalar JSON -type LoadBalancer implements Node & IPv4Addressable @key(fields: "id") { +type LoadBalancer implements Node & IPAddressable @key(fields: "id") @prefixedID(prefix: "loadbal") { """The ID for the load balancer.""" id: ID! createdAt: Time! updatedAt: Time! """The name of the load balancer.""" name: String! - annotations( - """Returns the elements in the list that come after the specified cursor.""" - after: Cursor - - """Returns the first _n_ elements from the list.""" - first: Int - - """Returns the elements in the list that come before the specified cursor.""" - before: Cursor - - """Returns the last _n_ elements from the list.""" - last: Int - - """Ordering options for LoadBalancerAnnotations returned from the connection.""" - orderBy: LoadBalancerAnnotationOrder - - """Filtering options for LoadBalancerAnnotations returned from the connection.""" - where: LoadBalancerAnnotationWhereInput - ): LoadBalancerAnnotationConnection! - statuses( + ports( """Returns the elements in the list that come after the specified cursor.""" after: Cursor @@ -1785,27 +1560,8 @@ type LoadBalancer implements Node & IPv4Addressable @key(fields: "id") { """Returns the last _n_ elements from the list.""" last: Int - """Ordering options for LoadBalancerStatusSlice returned from the connection.""" - orderBy: LoadBalancerStatusOrder - - """Filtering options for LoadBalancerStatusSlice returned from the connection.""" - where: LoadBalancerStatusWhereInput - ): LoadBalancerStatusConnection! - ports( - """Returns the elements in the list that come after the specified cursor.""" - after: Cursor - - """Returns the first _n_ elements from the list.""" - first: Int - - """Returns the elements in the list that come before the specified cursor.""" - before: Cursor - - """Returns the last _n_ elements from the list.""" - last: Int - - """Ordering options for LoadBalancerPorts returned from the connection.""" - orderBy: LoadBalancerPortOrder + """Ordering options for LoadBalancerPorts returned from the connection.""" + orderBy: LoadBalancerPortOrder """Filtering options for LoadBalancerPorts returned from the connection.""" where: LoadBalancerPortWhereInput @@ -1813,80 +1569,6 @@ type LoadBalancer implements Node & IPv4Addressable @key(fields: "id") { """The load balancer provider for the load balancer.""" loadBalancerProvider: LoadBalancerProvider! @goField(name: "Provider", forceResolver: false) } -type LoadBalancerAnnotation implements Node @key(fields: "id") { - id: ID! - createdAt: Time! - updatedAt: Time! - loadBalancerID: ID! - loadBalancer: LoadBalancer! -} -"""A connection to a list of items.""" -type LoadBalancerAnnotationConnection { - """A list of edges.""" - edges: [LoadBalancerAnnotationEdge] - """Information to aid in pagination.""" - pageInfo: PageInfo! - """Identifies the total count of items in the connection.""" - totalCount: Int! -} -"""An edge in a connection.""" -type LoadBalancerAnnotationEdge { - """The item at the end of the edge.""" - node: LoadBalancerAnnotation - """A cursor for use in pagination.""" - cursor: Cursor! -} -"""Ordering options for LoadBalancerAnnotation connections""" -input LoadBalancerAnnotationOrder { - """The ordering direction.""" - direction: OrderDirection! = ASC - """The field by which to order LoadBalancerAnnotations.""" - field: LoadBalancerAnnotationOrderField! -} -"""Properties by which LoadBalancerAnnotation connections can be ordered.""" -enum LoadBalancerAnnotationOrderField { - CREATED_AT - UPDATED_AT -} -""" -LoadBalancerAnnotationWhereInput is used for filtering LoadBalancerAnnotation objects. -Input was generated by ent. -""" -input LoadBalancerAnnotationWhereInput { - not: LoadBalancerAnnotationWhereInput - and: [LoadBalancerAnnotationWhereInput!] - or: [LoadBalancerAnnotationWhereInput!] - """id field predicates""" - id: ID - idNEQ: ID - idIn: [ID!] - idNotIn: [ID!] - idGT: ID - idGTE: ID - idLT: ID - idLTE: ID - """created_at field predicates""" - createdAt: Time - createdAtNEQ: Time - createdAtIn: [Time!] - createdAtNotIn: [Time!] - createdAtGT: Time - createdAtGTE: Time - createdAtLT: Time - createdAtLTE: Time - """updated_at field predicates""" - updatedAt: Time - updatedAtNEQ: Time - updatedAtIn: [Time!] - updatedAtNotIn: [Time!] - updatedAtGT: Time - updatedAtGTE: Time - updatedAtLT: Time - updatedAtLTE: Time - """load_balancer edge predicates""" - hasLoadBalancer: Boolean - hasLoadBalancerWith: [LoadBalancerWhereInput!] -} """A connection to a list of items.""" type LoadBalancerConnection { """A list of edges.""" @@ -1918,7 +1600,7 @@ enum LoadBalancerOrderField { NAME OWNER } -type LoadBalancerOrigin implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Origin") { +type LoadBalancerOrigin implements Node @key(fields: "id") @prefixedID(prefix: "loadogn") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Origin") { id: ID! createdAt: Time! updatedAt: Time! @@ -2040,7 +1722,7 @@ input LoadBalancerOriginWhereInput { hasPool: Boolean hasPoolWith: [LoadBalancerPoolWhereInput!] } -type LoadBalancerPool implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Pool") { +type LoadBalancerPool implements Node @key(fields: "id") @prefixedID(prefix: "loadpol") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Pool") { id: ID! createdAt: Time! updatedAt: Time! @@ -2164,7 +1846,7 @@ input LoadBalancerPoolWhereInput { hasOrigins: Boolean hasOriginsWith: [LoadBalancerOriginWhereInput!] } -type LoadBalancerPort implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Port") { +type LoadBalancerPort implements Node @key(fields: "id") @prefixedID(prefix: "loadprt") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Port") { id: ID! createdAt: Time! updatedAt: Time! @@ -2269,7 +1951,7 @@ input LoadBalancerPortWhereInput { hasLoadBalancer: Boolean hasLoadBalancerWith: [LoadBalancerWhereInput!] } -type LoadBalancerProvider implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Provider") { +type LoadBalancerProvider implements Node @key(fields: "id") @prefixedID(prefix: "loadpvd") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Provider") { """The ID for the load balancer provider.""" id: ID! createdAt: Time! @@ -2380,95 +2062,6 @@ input LoadBalancerProviderWhereInput { hasLoadBalancers: Boolean hasLoadBalancersWith: [LoadBalancerWhereInput!] } -type LoadBalancerStatus implements Node @key(fields: "id") { - id: ID! - createdAt: Time! - updatedAt: Time! - loadBalancerID: ID! - source: String! - loadBalancer: LoadBalancer! -} -"""A connection to a list of items.""" -type LoadBalancerStatusConnection { - """A list of edges.""" - edges: [LoadBalancerStatusEdge] - """Information to aid in pagination.""" - pageInfo: PageInfo! - """Identifies the total count of items in the connection.""" - totalCount: Int! -} -"""An edge in a connection.""" -type LoadBalancerStatusEdge { - """The item at the end of the edge.""" - node: LoadBalancerStatus - """A cursor for use in pagination.""" - cursor: Cursor! -} -"""Ordering options for LoadBalancerStatus connections""" -input LoadBalancerStatusOrder { - """The ordering direction.""" - direction: OrderDirection! = ASC - """The field by which to order LoadBalancerStatusSlice.""" - field: LoadBalancerStatusOrderField! -} -"""Properties by which LoadBalancerStatus connections can be ordered.""" -enum LoadBalancerStatusOrderField { - CREATED_AT - UPDATED_AT -} -""" -LoadBalancerStatusWhereInput is used for filtering LoadBalancerStatus objects. -Input was generated by ent. -""" -input LoadBalancerStatusWhereInput { - not: LoadBalancerStatusWhereInput - and: [LoadBalancerStatusWhereInput!] - or: [LoadBalancerStatusWhereInput!] - """id field predicates""" - id: ID - idNEQ: ID - idIn: [ID!] - idNotIn: [ID!] - idGT: ID - idGTE: ID - idLT: ID - idLTE: ID - """created_at field predicates""" - createdAt: Time - createdAtNEQ: Time - createdAtIn: [Time!] - createdAtNotIn: [Time!] - createdAtGT: Time - createdAtGTE: Time - createdAtLT: Time - createdAtLTE: Time - """updated_at field predicates""" - updatedAt: Time - updatedAtNEQ: Time - updatedAtIn: [Time!] - updatedAtNotIn: [Time!] - updatedAtGT: Time - updatedAtGTE: Time - updatedAtLT: Time - updatedAtLTE: Time - """source field predicates""" - source: String - sourceNEQ: String - sourceIn: [String!] - sourceNotIn: [String!] - sourceGT: String - sourceGTE: String - sourceLT: String - sourceLTE: String - sourceContains: String - sourceHasPrefix: String - sourceHasSuffix: String - sourceEqualFold: String - sourceContainsFold: String - """load_balancer edge predicates""" - hasLoadBalancer: Boolean - hasLoadBalancerWith: [LoadBalancerWhereInput!] -} """ LoadBalancerWhereInput is used for filtering LoadBalancer objects. Input was generated by ent. @@ -2518,12 +2111,6 @@ input LoadBalancerWhereInput { nameHasSuffix: String nameEqualFold: String nameContainsFold: String - """annotations edge predicates""" - hasAnnotations: Boolean - hasAnnotationsWith: [LoadBalancerAnnotationWhereInput!] - """statuses edge predicates""" - hasStatuses: Boolean - hasStatusesWith: [LoadBalancerStatusWhereInput!] """ports edge predicates""" hasPorts: Boolean hasPortsWith: [LoadBalancerPortWhereInput!] @@ -2632,7 +2219,7 @@ input UpdateLoadBalancerProviderInput { name: String } `, BuiltIn: false}, - {Name: "../../schema/ipam.graphql", Input: `extend interface IPv4Addressable { + {Name: "../../schema/ipam.graphql", Input: `interface IPAddressable { id: ID! } `, BuiltIn: false}, @@ -2698,8 +2285,10 @@ type LoadBalancerUpdatePayload { loadBalancer: LoadBalancer! } `, BuiltIn: false}, - {Name: "../../schema/location.graphql", Input: `extend type Location @key(fields: "id") { - id: ID! @external + {Name: "../../schema/location.graphql", Input: `directive @prefixedID(prefix: String!) on OBJECT + +type Location @key(fields: "id") { + id: ID! loadBalancers( """ Returns the elements in the list that come after the specified cursor. @@ -2740,21 +2329,26 @@ extend type LoadBalancer { location: Location! @goField(forceResolver: true) } `, BuiltIn: false}, - {Name: "../../schema/origin.graphql", Input: `extend type Mutation { - """ - Create a loadbalancer pool origin - """ - loadBalancerOriginCreate(input: CreateLoadBalancerOriginInput!): LoadBalancerOriginCreatePayload! + {Name: "../../schema/origin.graphql", Input: `type Mutation { + """ + Create a loadbalancer pool origin + """ + loadBalancerOriginCreate( + input: CreateLoadBalancerOriginInput! + ): LoadBalancerOriginCreatePayload! - """ - Update a loadbalancer pool origin - """ - loadBalancerOriginUpdate(id: ID!, input: UpdateLoadBalancerOriginInput!): LoadBalancerOriginUpdatePayload! + """ + Update a loadbalancer pool origin + """ + loadBalancerOriginUpdate( + id: ID! + input: UpdateLoadBalancerOriginInput! + ): LoadBalancerOriginUpdatePayload! - """ - Delete a loadbalancer pool origin - """ - loadBalancerOriginDelete(id: ID!): LoadBalancerOriginDeletePayload! + """ + Delete a loadbalancer pool origin + """ + loadBalancerOriginDelete(id: ID!): LoadBalancerOriginDeletePayload! } """ @@ -2787,8 +2381,8 @@ type LoadBalancerOriginDeletePayload { deletedID: ID! } `, BuiltIn: false}, - {Name: "../../schema/owner.graphql", Input: `extend type Owner @key(fields: "id") { - id: ID! @external + {Name: "../../schema/owner.graphql", Input: `type ResourceOwner @interfaceObject @key(fields: "id") { + id: ID! loadBalancers( """ Returns the elements in the list that come after the specified cursor. @@ -2888,21 +2482,21 @@ extend type LoadBalancer { """ The owner of the load balancer. """ - owner: Owner! @goField(forceResolver: true) + owner: ResourceOwner! @goField(forceResolver: true) } extend type LoadBalancerPool { """ The owner of the load balancer pool. """ - owner: Owner! @goField(forceResolver: true) + owner: ResourceOwner! @goField(forceResolver: true) } extend type LoadBalancerProvider { """ The owner of the load balancer provider. """ - owner: Owner! @goField(forceResolver: true) + owner: ResourceOwner! @goField(forceResolver: true) } `, BuiltIn: false}, {Name: "../../schema/pool.graphql", Input: `extend type Query { @@ -3075,35 +2669,54 @@ type LoadBalancerProviderUpdatePayload { } `, BuiltIn: false}, {Name: "../../federation/directives.graphql", Input: ` - scalar _Any - scalar _FieldSet - directive @requires(fields: _FieldSet!) on FIELD_DEFINITION - directive @provides(fields: _FieldSet!) on FIELD_DEFINITION + directive @composeDirective(name: String!) repeatable on SCHEMA directive @extends on OBJECT | INTERFACE - - directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE - directive @external on FIELD_DEFINITION | OBJECT + directive @external on OBJECT | FIELD_DEFINITION + directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @inaccessible on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + directive @interfaceObject on OBJECT directive @link(import: [String!], url: String!) repeatable on SCHEMA - directive @shareable on OBJECT | FIELD_DEFINITION - directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION directive @override(from: String!) on FIELD_DEFINITION - directive @inaccessible on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION + directive @provides(fields: FieldSet!) on FIELD_DEFINITION + directive @requires(fields: FieldSet!) on FIELD_DEFINITION + directive @shareable repeatable on FIELD_DEFINITION | OBJECT + directive @tag(name: String!) repeatable on + | ARGUMENT_DEFINITION + | ENUM + | ENUM_VALUE + | FIELD_DEFINITION + | INPUT_FIELD_DEFINITION + | INPUT_OBJECT + | INTERFACE + | OBJECT + | SCALAR + | UNION + scalar _Any + scalar FieldSet `, BuiltIn: true}, {Name: "../../federation/entity.graphql", Input: ` # a union of all types that use the @key directive -union _Entity = LoadBalancer | LoadBalancerAnnotation | LoadBalancerOrigin | LoadBalancerPool | LoadBalancerPort | LoadBalancerProvider | LoadBalancerStatus | Location | Owner +union _Entity = LoadBalancer | LoadBalancerOrigin | LoadBalancerPool | LoadBalancerPort | LoadBalancerProvider | Location | ResourceOwner # fake type to build resolver interfaces for users to implement type Entity { findLoadBalancerByID(id: ID!,): LoadBalancer! - findLoadBalancerAnnotationByID(id: ID!,): LoadBalancerAnnotation! findLoadBalancerOriginByID(id: ID!,): LoadBalancerOrigin! findLoadBalancerPoolByID(id: ID!,): LoadBalancerPool! findLoadBalancerPortByID(id: ID!,): LoadBalancerPort! findLoadBalancerProviderByID(id: ID!,): LoadBalancerProvider! - findLoadBalancerStatusByID(id: ID!,): LoadBalancerStatus! findLocationByID(id: ID!,): Location! - findOwnerByID(id: ID!,): Owner! + findResourceOwnerByID(id: ID!,): ResourceOwner! } @@ -3123,18 +2736,18 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) // region ***************************** args.gotpl ***************************** -func (ec *executionContext) field_Entity_findLoadBalancerAnnotationByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) dir_composeDirective_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 gidx.PrefixedID - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, tmp) + var arg0 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["id"] = arg0 + args["name"] = arg0 return args, nil } @@ -3213,21 +2826,6 @@ func (ec *executionContext) field_Entity_findLoadBalancerProviderByID_args(ctx c return args, nil } -func (ec *executionContext) field_Entity_findLoadBalancerStatusByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 gidx.PrefixedID - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - return args, nil -} - func (ec *executionContext) field_Entity_findLocationByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -3243,7 +2841,7 @@ func (ec *executionContext) field_Entity_findLocationByID_args(ctx context.Conte return args, nil } -func (ec *executionContext) field_Entity_findOwnerByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Entity_findResourceOwnerByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 gidx.PrefixedID @@ -3378,7 +2976,7 @@ func (ec *executionContext) field_LoadBalancerProvider_loadBalancers_args(ctx co return args, nil } -func (ec *executionContext) field_LoadBalancer_annotations_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_LoadBalancer_ports_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *entgql.Cursor[gidx.PrefixedID] @@ -3417,19 +3015,19 @@ func (ec *executionContext) field_LoadBalancer_annotations_args(ctx context.Cont } } args["last"] = arg3 - var arg4 *generated.LoadBalancerAnnotationOrder + var arg4 *generated.LoadBalancerPortOrder if tmp, ok := rawArgs["orderBy"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) - arg4, err = ec.unmarshalOLoadBalancerAnnotationOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationOrder(ctx, tmp) + arg4, err = ec.unmarshalOLoadBalancerPortOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortOrder(ctx, tmp) if err != nil { return nil, err } } args["orderBy"] = arg4 - var arg5 *generated.LoadBalancerAnnotationWhereInput + var arg5 *generated.LoadBalancerPortWhereInput if tmp, ok := rawArgs["where"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg5, err = ec.unmarshalOLoadBalancerAnnotationWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationWhereInput(ctx, tmp) + arg5, err = ec.unmarshalOLoadBalancerPortWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortWhereInput(ctx, tmp) if err != nil { return nil, err } @@ -3438,7 +3036,7 @@ func (ec *executionContext) field_LoadBalancer_annotations_args(ctx context.Cont return args, nil } -func (ec *executionContext) field_LoadBalancer_ports_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Location_loadBalancers_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *entgql.Cursor[gidx.PrefixedID] @@ -3477,19 +3075,19 @@ func (ec *executionContext) field_LoadBalancer_ports_args(ctx context.Context, r } } args["last"] = arg3 - var arg4 *generated.LoadBalancerPortOrder + var arg4 *generated.LoadBalancerOrder if tmp, ok := rawArgs["orderBy"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) - arg4, err = ec.unmarshalOLoadBalancerPortOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortOrder(ctx, tmp) + arg4, err = ec.unmarshalOLoadBalancerOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOrder(ctx, tmp) if err != nil { return nil, err } } args["orderBy"] = arg4 - var arg5 *generated.LoadBalancerPortWhereInput + var arg5 *generated.LoadBalancerWhereInput if tmp, ok := rawArgs["where"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg5, err = ec.unmarshalOLoadBalancerPortWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortWhereInput(ctx, tmp) + arg5, err = ec.unmarshalOLoadBalancerWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerWhereInput(ctx, tmp) if err != nil { return nil, err } @@ -3498,163 +3096,43 @@ func (ec *executionContext) field_LoadBalancer_ports_args(ctx context.Context, r return args, nil } -func (ec *executionContext) field_LoadBalancer_statuses_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_loadBalancerCreate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *entgql.Cursor[gidx.PrefixedID] - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) - if err != nil { - return nil, err - } - } - args["after"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } - } - args["first"] = arg1 - var arg2 *entgql.Cursor[gidx.PrefixedID] - if tmp, ok := rawArgs["before"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) - arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) - if err != nil { - return nil, err - } - } - args["before"] = arg2 - var arg3 *int - if tmp, ok := rawArgs["last"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) - arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } - } - args["last"] = arg3 - var arg4 *generated.LoadBalancerStatusOrder - if tmp, ok := rawArgs["orderBy"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) - arg4, err = ec.unmarshalOLoadBalancerStatusOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusOrder(ctx, tmp) + var arg0 generated.CreateLoadBalancerInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateLoadBalancerInput2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐCreateLoadBalancerInput(ctx, tmp) if err != nil { return nil, err } } - args["orderBy"] = arg4 - var arg5 *generated.LoadBalancerStatusWhereInput - if tmp, ok := rawArgs["where"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg5, err = ec.unmarshalOLoadBalancerStatusWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusWhereInput(ctx, tmp) + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_loadBalancerDelete_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 gidx.PrefixedID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, tmp) if err != nil { return nil, err } } - args["where"] = arg5 + args["id"] = arg0 return args, nil } -func (ec *executionContext) field_Location_loadBalancers_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_loadBalancerOriginCreate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *entgql.Cursor[gidx.PrefixedID] - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) - if err != nil { - return nil, err - } - } - args["after"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } - } - args["first"] = arg1 - var arg2 *entgql.Cursor[gidx.PrefixedID] - if tmp, ok := rawArgs["before"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) - arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) - if err != nil { - return nil, err - } - } - args["before"] = arg2 - var arg3 *int - if tmp, ok := rawArgs["last"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) - arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } - } - args["last"] = arg3 - var arg4 *generated.LoadBalancerOrder - if tmp, ok := rawArgs["orderBy"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) - arg4, err = ec.unmarshalOLoadBalancerOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOrder(ctx, tmp) - if err != nil { - return nil, err - } - } - args["orderBy"] = arg4 - var arg5 *generated.LoadBalancerWhereInput - if tmp, ok := rawArgs["where"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg5, err = ec.unmarshalOLoadBalancerWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerWhereInput(ctx, tmp) - if err != nil { - return nil, err - } - } - args["where"] = arg5 - return args, nil -} - -func (ec *executionContext) field_Mutation_loadBalancerCreate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 generated.CreateLoadBalancerInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNCreateLoadBalancerInput2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐCreateLoadBalancerInput(ctx, tmp) - if err != nil { - return nil, err - } - } - args["input"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Mutation_loadBalancerDelete_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 gidx.PrefixedID - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Mutation_loadBalancerOriginCreate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 generated.CreateLoadBalancerOriginInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNCreateLoadBalancerOriginInput2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐCreateLoadBalancerOriginInput(ctx, tmp) + var arg0 generated.CreateLoadBalancerOriginInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateLoadBalancerOriginInput2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐCreateLoadBalancerOriginInput(ctx, tmp) if err != nil { return nil, err } @@ -3888,7 +3366,52 @@ func (ec *executionContext) field_Mutation_loadBalancerUpdate_args(ctx context.C return args, nil } -func (ec *executionContext) field_Owner_loadBalancerPools_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []map[string]interface{} + if tmp, ok := rawArgs["representations"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) + arg0, err = ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["representations"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_loadBalancerPool_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 gidx.PrefixedID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_loadBalancerPools_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *entgql.Cursor[gidx.PrefixedID] @@ -3948,7 +3471,37 @@ func (ec *executionContext) field_Owner_loadBalancerPools_args(ctx context.Conte return args, nil } -func (ec *executionContext) field_Owner_loadBalancersProviders_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_loadBalancerProvider_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 gidx.PrefixedID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_loadBalancer_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 gidx.PrefixedID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_ResourceOwner_loadBalancerPools_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *entgql.Cursor[gidx.PrefixedID] @@ -3987,19 +3540,19 @@ func (ec *executionContext) field_Owner_loadBalancersProviders_args(ctx context. } } args["last"] = arg3 - var arg4 *generated.LoadBalancerOrder + var arg4 *generated.LoadBalancerPoolOrder if tmp, ok := rawArgs["orderBy"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) - arg4, err = ec.unmarshalOLoadBalancerOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOrder(ctx, tmp) + arg4, err = ec.unmarshalOLoadBalancerPoolOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolOrder(ctx, tmp) if err != nil { return nil, err } } args["orderBy"] = arg4 - var arg5 *generated.LoadBalancerProviderWhereInput + var arg5 *generated.LoadBalancerPoolWhereInput if tmp, ok := rawArgs["where"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg5, err = ec.unmarshalOLoadBalancerProviderWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderWhereInput(ctx, tmp) + arg5, err = ec.unmarshalOLoadBalancerPoolWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInput(ctx, tmp) if err != nil { return nil, err } @@ -4008,7 +3561,7 @@ func (ec *executionContext) field_Owner_loadBalancersProviders_args(ctx context. return args, nil } -func (ec *executionContext) field_Owner_loadBalancers_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_ResourceOwner_loadBalancersProviders_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *entgql.Cursor[gidx.PrefixedID] @@ -4056,10 +3609,10 @@ func (ec *executionContext) field_Owner_loadBalancers_args(ctx context.Context, } } args["orderBy"] = arg4 - var arg5 *generated.LoadBalancerWhereInput + var arg5 *generated.LoadBalancerProviderWhereInput if tmp, ok := rawArgs["where"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg5, err = ec.unmarshalOLoadBalancerWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerWhereInput(ctx, tmp) + arg5, err = ec.unmarshalOLoadBalancerProviderWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderWhereInput(ctx, tmp) if err != nil { return nil, err } @@ -4068,52 +3621,7 @@ func (ec *executionContext) field_Owner_loadBalancers_args(ctx context.Context, return args, nil } -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 []map[string]interface{} - if tmp, ok := rawArgs["representations"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) - arg0, err = ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) - if err != nil { - return nil, err - } - } - args["representations"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_loadBalancerPool_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 gidx.PrefixedID - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_loadBalancerPools_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_ResourceOwner_loadBalancers_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *entgql.Cursor[gidx.PrefixedID] @@ -4152,19 +3660,19 @@ func (ec *executionContext) field_Query_loadBalancerPools_args(ctx context.Conte } } args["last"] = arg3 - var arg4 *generated.LoadBalancerPoolOrder + var arg4 *generated.LoadBalancerOrder if tmp, ok := rawArgs["orderBy"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) - arg4, err = ec.unmarshalOLoadBalancerPoolOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolOrder(ctx, tmp) + arg4, err = ec.unmarshalOLoadBalancerOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOrder(ctx, tmp) if err != nil { return nil, err } } args["orderBy"] = arg4 - var arg5 *generated.LoadBalancerPoolWhereInput + var arg5 *generated.LoadBalancerWhereInput if tmp, ok := rawArgs["where"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg5, err = ec.unmarshalOLoadBalancerPoolWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInput(ctx, tmp) + arg5, err = ec.unmarshalOLoadBalancerWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerWhereInput(ctx, tmp) if err != nil { return nil, err } @@ -4173,63 +3681,33 @@ func (ec *executionContext) field_Query_loadBalancerPools_args(ctx context.Conte return args, nil } -func (ec *executionContext) field_Query_loadBalancerProvider_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 gidx.PrefixedID - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, tmp) + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err } } - args["id"] = arg0 + args["includeDeprecated"] = arg0 return args, nil } -func (ec *executionContext) field_Query_loadBalancer_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 gidx.PrefixedID - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, tmp) + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err } } - args["id"] = arg0 - return args, nil -} - -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["includeDeprecated"] = arg0 - return args, nil -} - -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["includeDeprecated"] = arg0 + args["includeDeprecated"] = arg0 return args, nil } @@ -4288,10 +3766,6 @@ func (ec *executionContext) fieldContext_Entity_findLoadBalancerByID(ctx context return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) case "name": return ec.fieldContext_LoadBalancer_name(ctx, field) - case "annotations": - return ec.fieldContext_LoadBalancer_annotations(ctx, field) - case "statuses": - return ec.fieldContext_LoadBalancer_statuses(ctx, field) case "ports": return ec.fieldContext_LoadBalancer_ports(ctx, field) case "loadBalancerProvider": @@ -4313,74 +3787,7 @@ func (ec *executionContext) fieldContext_Entity_findLoadBalancerByID(ctx context ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Entity_findLoadBalancerByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Entity_findLoadBalancerAnnotationByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Entity_findLoadBalancerAnnotationByID(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 ec.resolvers.Entity().FindLoadBalancerAnnotationByID(rctx, fc.Args["id"].(gidx.PrefixedID)) - }) - 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.LoadBalancerAnnotation) - fc.Result = res - return ec.marshalNLoadBalancerAnnotation2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotation(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Entity_findLoadBalancerAnnotationByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Entity", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerAnnotation_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerAnnotation_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerAnnotation_updatedAt(ctx, field) - case "loadBalancerID": - return ec.fieldContext_LoadBalancerAnnotation_loadBalancerID(ctx, field) - case "loadBalancer": - return ec.fieldContext_LoadBalancerAnnotation_loadBalancer(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerAnnotation", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Entity_findLoadBalancerAnnotationByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return + return fc, err } return fc, nil } @@ -4455,7 +3862,7 @@ func (ec *executionContext) fieldContext_Entity_findLoadBalancerOriginByID(ctx c ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Entity_findLoadBalancerOriginByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } @@ -4530,7 +3937,7 @@ func (ec *executionContext) fieldContext_Entity_findLoadBalancerPoolByID(ctx con ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Entity_findLoadBalancerPoolByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } @@ -4603,7 +4010,7 @@ func (ec *executionContext) fieldContext_Entity_findLoadBalancerPortByID(ctx con ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Entity_findLoadBalancerPortByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } @@ -4672,76 +4079,7 @@ func (ec *executionContext) fieldContext_Entity_findLoadBalancerProviderByID(ctx ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Entity_findLoadBalancerProviderByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Entity_findLoadBalancerStatusByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Entity_findLoadBalancerStatusByID(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 ec.resolvers.Entity().FindLoadBalancerStatusByID(rctx, fc.Args["id"].(gidx.PrefixedID)) - }) - 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.LoadBalancerStatus) - fc.Result = res - return ec.marshalNLoadBalancerStatus2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatus(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Entity_findLoadBalancerStatusByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Entity", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerStatus_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerStatus_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerStatus_updatedAt(ctx, field) - case "loadBalancerID": - return ec.fieldContext_LoadBalancerStatus_loadBalancerID(ctx, field) - case "source": - return ec.fieldContext_LoadBalancerStatus_source(ctx, field) - case "loadBalancer": - return ec.fieldContext_LoadBalancerStatus_loadBalancer(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerStatus", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Entity_findLoadBalancerStatusByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return + return fc, err } return fc, nil } @@ -4802,13 +4140,13 @@ func (ec *executionContext) fieldContext_Entity_findLocationByID(ctx context.Con ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Entity_findLocationByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } -func (ec *executionContext) _Entity_findOwnerByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Entity_findOwnerByID(ctx, field) +func (ec *executionContext) _Entity_findResourceOwnerByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findResourceOwnerByID(ctx, field) if err != nil { return graphql.Null } @@ -4821,7 +4159,7 @@ func (ec *executionContext) _Entity_findOwnerByID(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Entity().FindOwnerByID(rctx, fc.Args["id"].(gidx.PrefixedID)) + return ec.resolvers.Entity().FindResourceOwnerByID(rctx, fc.Args["id"].(gidx.PrefixedID)) }) if err != nil { ec.Error(ctx, err) @@ -4833,12 +4171,12 @@ func (ec *executionContext) _Entity_findOwnerByID(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(*Owner) + res := resTmp.(*ResourceOwner) fc.Result = res - return ec.marshalNOwner2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐOwner(ctx, field.Selections, res) + return ec.marshalNResourceOwner2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐResourceOwner(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Entity_findOwnerByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Entity_findResourceOwnerByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Entity", Field: field, @@ -4847,15 +4185,15 @@ func (ec *executionContext) fieldContext_Entity_findOwnerByID(ctx context.Contex Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_Owner_id(ctx, field) + return ec.fieldContext_ResourceOwner_id(ctx, field) case "loadBalancers": - return ec.fieldContext_Owner_loadBalancers(ctx, field) + return ec.fieldContext_ResourceOwner_loadBalancers(ctx, field) case "loadBalancerPools": - return ec.fieldContext_Owner_loadBalancerPools(ctx, field) + return ec.fieldContext_ResourceOwner_loadBalancerPools(ctx, field) case "loadBalancersProviders": - return ec.fieldContext_Owner_loadBalancersProviders(ctx, field) + return ec.fieldContext_ResourceOwner_loadBalancersProviders(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Owner", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ResourceOwner", field.Name) }, } defer func() { @@ -4865,9 +4203,9 @@ func (ec *executionContext) fieldContext_Entity_findOwnerByID(ctx context.Contex } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Entity_findOwnerByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Entity_findResourceOwnerByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } @@ -5048,132 +4386,6 @@ func (ec *executionContext) fieldContext_LoadBalancer_name(ctx context.Context, return fc, nil } -func (ec *executionContext) _LoadBalancer_annotations(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancer) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancer_annotations(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.Annotations(ctx, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerAnnotationOrder), fc.Args["where"].(*generated.LoadBalancerAnnotationWhereInput)) - }) - 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.LoadBalancerAnnotationConnection) - fc.Result = res - return ec.marshalNLoadBalancerAnnotationConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationConnection(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_LoadBalancer_annotations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "LoadBalancer", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_LoadBalancerAnnotationConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_LoadBalancerAnnotationConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_LoadBalancerAnnotationConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerAnnotationConnection", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_LoadBalancer_annotations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _LoadBalancer_statuses(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancer) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancer_statuses(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.Statuses(ctx, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerStatusOrder), fc.Args["where"].(*generated.LoadBalancerStatusWhereInput)) - }) - 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.LoadBalancerStatusConnection) - fc.Result = res - return ec.marshalNLoadBalancerStatusConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusConnection(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_LoadBalancer_statuses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "LoadBalancer", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_LoadBalancerStatusConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_LoadBalancerStatusConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_LoadBalancerStatusConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerStatusConnection", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_LoadBalancer_statuses_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - func (ec *executionContext) _LoadBalancer_ports(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancer) (ret graphql.Marshaler) { fc, err := ec.fieldContext_LoadBalancer_ports(ctx, field) if err != nil { @@ -5232,7 +4444,7 @@ func (ec *executionContext) fieldContext_LoadBalancer_ports(ctx context.Context, ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_LoadBalancer_ports_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } @@ -5371,9 +4583,9 @@ func (ec *executionContext) _LoadBalancer_owner(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(*Owner) + res := resTmp.(*ResourceOwner) fc.Result = res - return ec.marshalNOwner2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐOwner(ctx, field.Selections, res) + return ec.marshalNResourceOwner2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐResourceOwner(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_LoadBalancer_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -5385,22 +4597,22 @@ func (ec *executionContext) fieldContext_LoadBalancer_owner(ctx context.Context, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_Owner_id(ctx, field) + return ec.fieldContext_ResourceOwner_id(ctx, field) case "loadBalancers": - return ec.fieldContext_Owner_loadBalancers(ctx, field) + return ec.fieldContext_ResourceOwner_loadBalancers(ctx, field) case "loadBalancerPools": - return ec.fieldContext_Owner_loadBalancerPools(ctx, field) + return ec.fieldContext_ResourceOwner_loadBalancerPools(ctx, field) case "loadBalancersProviders": - return ec.fieldContext_Owner_loadBalancersProviders(ctx, field) + return ec.fieldContext_ResourceOwner_loadBalancersProviders(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Owner", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ResourceOwner", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerAnnotation_id(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerAnnotation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerAnnotation_id(ctx, field) +func (ec *executionContext) _LoadBalancerConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -5413,82 +4625,41 @@ func (ec *executionContext) _LoadBalancerAnnotation_id(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.ID, nil + return obj.Edges, 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) + res := resTmp.([]*generated.LoadBalancerEdge) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalOLoadBalancerEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerAnnotation_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerAnnotation", + Object: "LoadBalancerConnection", 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) _LoadBalancerAnnotation_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerAnnotation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerAnnotation_createdAt(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.CreatedAt, 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.(time.Time) - fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_LoadBalancerAnnotation_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "LoadBalancerAnnotation", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "node": + return ec.fieldContext_LoadBalancerEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_LoadBalancerEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerAnnotation_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerAnnotation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerAnnotation_updatedAt(ctx, field) +func (ec *executionContext) _LoadBalancerConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -5501,7 +4672,7 @@ func (ec *executionContext) _LoadBalancerAnnotation_updatedAt(ctx context.Contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -5513,26 +4684,36 @@ func (ec *executionContext) _LoadBalancerAnnotation_updatedAt(ctx context.Contex } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(entgql.PageInfo[gidx.PrefixedID]) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerAnnotation_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerAnnotation", + Object: "LoadBalancerConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerAnnotation_loadBalancerID(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerAnnotation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerAnnotation_loadBalancerID(ctx, field) +func (ec *executionContext) _LoadBalancerConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -5545,7 +4726,7 @@ func (ec *executionContext) _LoadBalancerAnnotation_loadBalancerID(ctx context.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancerID, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -5557,26 +4738,26 @@ func (ec *executionContext) _LoadBalancerAnnotation_loadBalancerID(ctx context.C } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.(int) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerAnnotation_loadBalancerID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerAnnotation", + Object: "LoadBalancerConnection", 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 Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerAnnotation_loadBalancer(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerAnnotation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerAnnotation_loadBalancer(ctx, field) +func (ec *executionContext) _LoadBalancerCreatePayload_loadBalancer(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerCreatePayload_loadBalancer(ctx, field) if err != nil { return graphql.Null } @@ -5589,7 +4770,7 @@ func (ec *executionContext) _LoadBalancerAnnotation_loadBalancer(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancer(ctx) + return obj.LoadBalancer, nil }) if err != nil { ec.Error(ctx, err) @@ -5606,11 +4787,11 @@ func (ec *executionContext) _LoadBalancerAnnotation_loadBalancer(ctx context.Con return ec.marshalNLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancer(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerAnnotation_loadBalancer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerCreatePayload_loadBalancer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerAnnotation", + Object: "LoadBalancerCreatePayload", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -5622,10 +4803,6 @@ func (ec *executionContext) fieldContext_LoadBalancerAnnotation_loadBalancer(ctx return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) case "name": return ec.fieldContext_LoadBalancer_name(ctx, field) - case "annotations": - return ec.fieldContext_LoadBalancer_annotations(ctx, field) - case "statuses": - return ec.fieldContext_LoadBalancer_statuses(ctx, field) case "ports": return ec.fieldContext_LoadBalancer_ports(ctx, field) case "loadBalancerProvider": @@ -5641,8 +4818,8 @@ func (ec *executionContext) fieldContext_LoadBalancerAnnotation_loadBalancer(ctx return fc, nil } -func (ec *executionContext) _LoadBalancerAnnotationConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerAnnotationConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerAnnotationConnection_edges(ctx, field) +func (ec *executionContext) _LoadBalancerDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerDeletePayload_deletedID(ctx, field) if err != nil { return graphql.Null } @@ -5655,41 +4832,38 @@ func (ec *executionContext) _LoadBalancerAnnotationConnection_edges(ctx context. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.DeletedID, 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.LoadBalancerAnnotationEdge) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalOLoadBalancerAnnotationEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationEdge(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerAnnotationConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerAnnotationConnection", + Object: "LoadBalancerDeletePayload", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "node": - return ec.fieldContext_LoadBalancerAnnotationEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_LoadBalancerAnnotationEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerAnnotationEdge", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerAnnotationConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerAnnotationConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerAnnotationConnection_pageInfo(ctx, field) +func (ec *executionContext) _LoadBalancerEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -5702,48 +4876,53 @@ func (ec *executionContext) _LoadBalancerAnnotationConnection_pageInfo(ctx conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.Node, 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.(entgql.PageInfo[gidx.PrefixedID]) + res := resTmp.(*generated.LoadBalancer) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalOLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancer(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerAnnotationConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerAnnotationConnection", + Object: "LoadBalancerEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "id": + return ec.fieldContext_LoadBalancer_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancer_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancer_name(ctx, field) + case "ports": + return ec.fieldContext_LoadBalancer_ports(ctx, field) + case "loadBalancerProvider": + return ec.fieldContext_LoadBalancer_loadBalancerProvider(ctx, field) + case "location": + return ec.fieldContext_LoadBalancer_location(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancer_owner(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancer", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerAnnotationConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerAnnotationConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerAnnotationConnection_totalCount(ctx, field) +func (ec *executionContext) _LoadBalancerEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -5756,7 +4935,7 @@ func (ec *executionContext) _LoadBalancerAnnotationConnection_totalCount(ctx con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -5768,26 +4947,26 @@ func (ec *executionContext) _LoadBalancerAnnotationConnection_totalCount(ctx con } return graphql.Null } - res := resTmp.(int) + res := resTmp.(entgql.Cursor[gidx.PrefixedID]) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerAnnotationConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerAnnotationConnection", + Object: "LoadBalancerEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerAnnotationEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerAnnotationEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerAnnotationEdge_node(ctx, field) +func (ec *executionContext) _LoadBalancerOrigin_id(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOrigin_id(ctx, field) if err != nil { return graphql.Null } @@ -5800,47 +4979,38 @@ func (ec *executionContext) _LoadBalancerAnnotationEdge_node(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.ID, 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.LoadBalancerAnnotation) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalOLoadBalancerAnnotation2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotation(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerAnnotationEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOrigin_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerAnnotationEdge", + Object: "LoadBalancerOrigin", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerAnnotation_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerAnnotation_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerAnnotation_updatedAt(ctx, field) - case "loadBalancerID": - return ec.fieldContext_LoadBalancerAnnotation_loadBalancerID(ctx, field) - case "loadBalancer": - return ec.fieldContext_LoadBalancerAnnotation_loadBalancer(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerAnnotation", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerAnnotationEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerAnnotationEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerAnnotationEdge_cursor(ctx, field) +func (ec *executionContext) _LoadBalancerOrigin_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -5853,7 +5023,7 @@ func (ec *executionContext) _LoadBalancerAnnotationEdge_cursor(ctx context.Conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.CreatedAt, nil }) if err != nil { ec.Error(ctx, err) @@ -5865,26 +5035,26 @@ func (ec *executionContext) _LoadBalancerAnnotationEdge_cursor(ctx context.Conte } return graphql.Null } - res := resTmp.(entgql.Cursor[gidx.PrefixedID]) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerAnnotationEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOrigin_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerAnnotationEdge", + 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 Cursor does not have child fields") + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerConnection_edges(ctx, field) +func (ec *executionContext) _LoadBalancerOrigin_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) if err != nil { return graphql.Null } @@ -5897,41 +5067,38 @@ func (ec *executionContext) _LoadBalancerConnection_edges(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.UpdatedAt, 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.LoadBalancerEdge) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalOLoadBalancerEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerEdge(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOrigin_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerConnection", + Object: "LoadBalancerOrigin", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "node": - return ec.fieldContext_LoadBalancerEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_LoadBalancerEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerEdge", field.Name) + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerConnection_pageInfo(ctx, field) +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 { return graphql.Null } @@ -5944,7 +5111,7 @@ func (ec *executionContext) _LoadBalancerConnection_pageInfo(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -5956,36 +5123,26 @@ func (ec *executionContext) _LoadBalancerConnection_pageInfo(ctx context.Context } return graphql.Null } - res := resTmp.(entgql.PageInfo[gidx.PrefixedID]) + res := resTmp.(string) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOrigin_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerConnection", + Object: "LoadBalancerOrigin", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerConnection_totalCount(ctx, field) +func (ec *executionContext) _LoadBalancerOrigin_target(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOrigin_target(ctx, field) if err != nil { return graphql.Null } @@ -5998,7 +5155,7 @@ func (ec *executionContext) _LoadBalancerConnection_totalCount(ctx context.Conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Target, nil }) if err != nil { ec.Error(ctx, err) @@ -6010,26 +5167,26 @@ func (ec *executionContext) _LoadBalancerConnection_totalCount(ctx context.Conte } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOrigin_target(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerConnection", + 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 Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerCreatePayload_loadBalancer(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerCreatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerCreatePayload_loadBalancer(ctx, field) +func (ec *executionContext) _LoadBalancerOrigin_portNumber(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOrigin_portNumber(ctx, field) if err != nil { return graphql.Null } @@ -6042,7 +5199,7 @@ func (ec *executionContext) _LoadBalancerCreatePayload_loadBalancer(ctx context. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancer, nil + return obj.PortNumber, nil }) if err != nil { ec.Error(ctx, err) @@ -6054,48 +5211,26 @@ func (ec *executionContext) _LoadBalancerCreatePayload_loadBalancer(ctx context. } return graphql.Null } - res := resTmp.(*generated.LoadBalancer) + res := resTmp.(int) fc.Result = res - return ec.marshalNLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancer(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerCreatePayload_loadBalancer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOrigin_portNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerCreatePayload", + Object: "LoadBalancerOrigin", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancer_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancer_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancer_name(ctx, field) - case "annotations": - return ec.fieldContext_LoadBalancer_annotations(ctx, field) - case "statuses": - return ec.fieldContext_LoadBalancer_statuses(ctx, field) - case "ports": - return ec.fieldContext_LoadBalancer_ports(ctx, field) - case "loadBalancerProvider": - return ec.fieldContext_LoadBalancer_loadBalancerProvider(ctx, field) - case "location": - return ec.fieldContext_LoadBalancer_location(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancer_owner(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancer", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerDeletePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerDeletePayload_deletedID(ctx, field) +func (ec *executionContext) _LoadBalancerOrigin_active(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOrigin_active(ctx, field) if err != nil { return graphql.Null } @@ -6108,7 +5243,7 @@ func (ec *executionContext) _LoadBalancerDeletePayload_deletedID(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeletedID, nil + return obj.Active, nil }) if err != nil { ec.Error(ctx, err) @@ -6120,26 +5255,26 @@ func (ec *executionContext) _LoadBalancerDeletePayload_deletedID(ctx context.Con } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.(bool) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOrigin_active(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerDeletePayload", + 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 ID does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerEdge_node(ctx, field) +func (ec *executionContext) _LoadBalancerOrigin_poolID(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOrigin_poolID(ctx, field) if err != nil { return graphql.Null } @@ -6152,57 +5287,38 @@ func (ec *executionContext) _LoadBalancerEdge_node(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.Node, nil + return obj.PoolID, 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.LoadBalancer) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalOLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancer(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOrigin_poolID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerEdge", + Object: "LoadBalancerOrigin", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancer_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancer_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancer_name(ctx, field) - case "annotations": - return ec.fieldContext_LoadBalancer_annotations(ctx, field) - case "statuses": - return ec.fieldContext_LoadBalancer_statuses(ctx, field) - case "ports": - return ec.fieldContext_LoadBalancer_ports(ctx, field) - case "loadBalancerProvider": - return ec.fieldContext_LoadBalancer_loadBalancerProvider(ctx, field) - case "location": - return ec.fieldContext_LoadBalancer_location(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancer_owner(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancer", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerEdge_cursor(ctx, field) +func (ec *executionContext) _LoadBalancerOrigin_pool(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOrigin_pool(ctx, field) if err != nil { return graphql.Null } @@ -6215,7 +5331,7 @@ func (ec *executionContext) _LoadBalancerEdge_cursor(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.Cursor, nil + return obj.Pool(ctx) }) if err != nil { ec.Error(ctx, err) @@ -6227,26 +5343,46 @@ func (ec *executionContext) _LoadBalancerEdge_cursor(ctx context.Context, field } return graphql.Null } - res := resTmp.(entgql.Cursor[gidx.PrefixedID]) + res := resTmp.(*generated.Pool) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPool2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOrigin_pool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerEdge", + Object: "LoadBalancerOrigin", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Cursor does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_LoadBalancerPool_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerPool_name(ctx, field) + case "protocol": + return ec.fieldContext_LoadBalancerPool_protocol(ctx, field) + case "ownerID": + return ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) + case "ports": + return ec.fieldContext_LoadBalancerPool_ports(ctx, field) + case "origins": + return ec.fieldContext_LoadBalancerPool_origins(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancerPool_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPool", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOrigin_id(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOrigin_id(ctx, field) +func (ec *executionContext) _LoadBalancerOriginConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerOriginConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOriginConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -6259,38 +5395,41 @@ func (ec *executionContext) _LoadBalancerOrigin_id(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.ID, nil + return obj.Edges, 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) + res := resTmp.([]*generated.LoadBalancerOriginEdge) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalOLoadBalancerOriginEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOrigin_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOriginConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOrigin", + Object: "LoadBalancerOriginConnection", 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") + switch field.Name { + case "node": + return ec.fieldContext_LoadBalancerOriginEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_LoadBalancerOriginEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOriginEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOrigin_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) +func (ec *executionContext) _LoadBalancerOriginConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerOriginConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOriginConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -6303,7 +5442,7 @@ func (ec *executionContext) _LoadBalancerOrigin_createdAt(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -6315,26 +5454,36 @@ func (ec *executionContext) _LoadBalancerOrigin_createdAt(ctx context.Context, f } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(entgql.PageInfo[gidx.PrefixedID]) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOrigin_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOriginConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOrigin", + Object: "LoadBalancerOriginConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOrigin_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) +func (ec *executionContext) _LoadBalancerOriginConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerOriginConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOriginConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -6347,7 +5496,7 @@ func (ec *executionContext) _LoadBalancerOrigin_updatedAt(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -6359,26 +5508,26 @@ func (ec *executionContext) _LoadBalancerOrigin_updatedAt(ctx context.Context, f } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(int) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOrigin_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOriginConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOrigin", + Object: "LoadBalancerOriginConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + return nil, errors.New("field of type Int 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) +func (ec *executionContext) _LoadBalancerOriginCreatePayload_loadBalancerOrigin(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerOriginCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOriginCreatePayload_loadBalancerOrigin(ctx, field) if err != nil { return graphql.Null } @@ -6391,7 +5540,7 @@ func (ec *executionContext) _LoadBalancerOrigin_name(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.Name, nil + return obj.LoadBalancerOrigin, nil }) if err != nil { ec.Error(ctx, err) @@ -6403,26 +5552,46 @@ func (ec *executionContext) _LoadBalancerOrigin_name(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*generated.Origin) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNLoadBalancerOrigin2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐOrigin(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOrigin_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOriginCreatePayload_loadBalancerOrigin(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOrigin", + Object: "LoadBalancerOriginCreatePayload", 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") + switch field.Name { + case "id": + return ec.fieldContext_LoadBalancerOrigin_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerOrigin_name(ctx, field) + case "target": + return ec.fieldContext_LoadBalancerOrigin_target(ctx, field) + case "portNumber": + return ec.fieldContext_LoadBalancerOrigin_portNumber(ctx, field) + case "active": + return ec.fieldContext_LoadBalancerOrigin_active(ctx, field) + case "poolID": + return ec.fieldContext_LoadBalancerOrigin_poolID(ctx, field) + case "pool": + return ec.fieldContext_LoadBalancerOrigin_pool(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOrigin", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOrigin_target(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOrigin_target(ctx, field) +func (ec *executionContext) _LoadBalancerOriginDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerOriginDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOriginDeletePayload_deletedID(ctx, field) if err != nil { return graphql.Null } @@ -6435,7 +5604,7 @@ func (ec *executionContext) _LoadBalancerOrigin_target(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.Target, nil + return obj.DeletedID, nil }) if err != nil { ec.Error(ctx, err) @@ -6447,26 +5616,26 @@ func (ec *executionContext) _LoadBalancerOrigin_target(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(string) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOrigin_target(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOriginDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOrigin", + Object: "LoadBalancerOriginDeletePayload", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOrigin_portNumber(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOrigin_portNumber(ctx, field) +func (ec *executionContext) _LoadBalancerOriginEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerOriginEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOriginEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -6479,38 +5648,55 @@ func (ec *executionContext) _LoadBalancerOrigin_portNumber(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PortNumber, nil + return obj.Node, 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.(int) + res := resTmp.(*generated.Origin) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOLoadBalancerOrigin2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐOrigin(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOrigin_portNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOriginEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOrigin", + Object: "LoadBalancerOriginEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_LoadBalancerOrigin_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerOrigin_name(ctx, field) + case "target": + return ec.fieldContext_LoadBalancerOrigin_target(ctx, field) + case "portNumber": + return ec.fieldContext_LoadBalancerOrigin_portNumber(ctx, field) + case "active": + return ec.fieldContext_LoadBalancerOrigin_active(ctx, field) + case "poolID": + return ec.fieldContext_LoadBalancerOrigin_poolID(ctx, field) + case "pool": + return ec.fieldContext_LoadBalancerOrigin_pool(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOrigin", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOrigin_active(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOrigin_active(ctx, field) +func (ec *executionContext) _LoadBalancerOriginEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerOriginEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOriginEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -6523,7 +5709,7 @@ func (ec *executionContext) _LoadBalancerOrigin_active(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.Active, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -6535,26 +5721,26 @@ func (ec *executionContext) _LoadBalancerOrigin_active(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(entgql.Cursor[gidx.PrefixedID]) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOrigin_active(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOriginEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOrigin", + Object: "LoadBalancerOriginEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOrigin_poolID(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOrigin_poolID(ctx, field) +func (ec *executionContext) _LoadBalancerOriginUpdatePayload_loadBalancerOrigin(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerOriginUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerOriginUpdatePayload_loadBalancerOrigin(ctx, field) if err != nil { return graphql.Null } @@ -6567,7 +5753,7 @@ func (ec *executionContext) _LoadBalancerOrigin_poolID(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.PoolID, nil + return obj.LoadBalancerOrigin, nil }) if err != nil { ec.Error(ctx, err) @@ -6579,26 +5765,46 @@ func (ec *executionContext) _LoadBalancerOrigin_poolID(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.(*generated.Origin) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNLoadBalancerOrigin2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐOrigin(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOrigin_poolID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerOriginUpdatePayload_loadBalancerOrigin(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOrigin", + Object: "LoadBalancerOriginUpdatePayload", 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") + switch field.Name { + case "id": + return ec.fieldContext_LoadBalancerOrigin_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerOrigin_name(ctx, field) + case "target": + return ec.fieldContext_LoadBalancerOrigin_target(ctx, field) + case "portNumber": + return ec.fieldContext_LoadBalancerOrigin_portNumber(ctx, field) + case "active": + return ec.fieldContext_LoadBalancerOrigin_active(ctx, field) + case "poolID": + return ec.fieldContext_LoadBalancerOrigin_poolID(ctx, field) + case "pool": + return ec.fieldContext_LoadBalancerOrigin_pool(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOrigin", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOrigin_pool(ctx context.Context, field graphql.CollectedField, obj *generated.Origin) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOrigin_pool(ctx, field) +func (ec *executionContext) _LoadBalancerPool_id(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPool_id(ctx, field) if err != nil { return graphql.Null } @@ -6611,7 +5817,7 @@ func (ec *executionContext) _LoadBalancerOrigin_pool(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.Pool(ctx) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -6623,46 +5829,26 @@ func (ec *executionContext) _LoadBalancerOrigin_pool(ctx context.Context, field } return graphql.Null } - res := resTmp.(*generated.Pool) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalNLoadBalancerPool2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPool(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOrigin_pool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPool_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOrigin", + 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_LoadBalancerPool_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancerPool_name(ctx, field) - case "protocol": - return ec.fieldContext_LoadBalancerPool_protocol(ctx, field) - case "ownerID": - return ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) - case "ports": - return ec.fieldContext_LoadBalancerPool_ports(ctx, field) - case "origins": - return ec.fieldContext_LoadBalancerPool_origins(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancerPool_owner(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPool", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOriginConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerOriginConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOriginConnection_edges(ctx, field) +func (ec *executionContext) _LoadBalancerPool_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -6675,41 +5861,38 @@ func (ec *executionContext) _LoadBalancerOriginConnection_edges(ctx context.Cont }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.CreatedAt, 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.LoadBalancerOriginEdge) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalOLoadBalancerOriginEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginEdge(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOriginConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPool_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOriginConnection", + Object: "LoadBalancerPool", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "node": - return ec.fieldContext_LoadBalancerOriginEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_LoadBalancerOriginEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOriginEdge", field.Name) + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOriginConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerOriginConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOriginConnection_pageInfo(ctx, field) +func (ec *executionContext) _LoadBalancerPool_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) if err != nil { return graphql.Null } @@ -6722,7 +5905,7 @@ func (ec *executionContext) _LoadBalancerOriginConnection_pageInfo(ctx context.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.UpdatedAt, nil }) if err != nil { ec.Error(ctx, err) @@ -6734,36 +5917,26 @@ func (ec *executionContext) _LoadBalancerOriginConnection_pageInfo(ctx context.C } return graphql.Null } - res := resTmp.(entgql.PageInfo[gidx.PrefixedID]) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOriginConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPool_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOriginConnection", + Object: "LoadBalancerPool", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOriginConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerOriginConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOriginConnection_totalCount(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 } @@ -6776,7 +5949,7 @@ func (ec *executionContext) _LoadBalancerOriginConnection_totalCount(ctx context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -6788,26 +5961,26 @@ func (ec *executionContext) _LoadBalancerOriginConnection_totalCount(ctx context } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOriginConnection_totalCount(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: "LoadBalancerOriginConnection", + 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 Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOriginCreatePayload_loadBalancerOrigin(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerOriginCreatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOriginCreatePayload_loadBalancerOrigin(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 } @@ -6820,7 +5993,7 @@ func (ec *executionContext) _LoadBalancerOriginCreatePayload_loadBalancerOrigin( }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancerOrigin, nil + return obj.Protocol, nil }) if err != nil { ec.Error(ctx, err) @@ -6832,46 +6005,26 @@ func (ec *executionContext) _LoadBalancerOriginCreatePayload_loadBalancerOrigin( } return graphql.Null } - res := resTmp.(*generated.Origin) + res := resTmp.(pool.Protocol) fc.Result = res - return ec.marshalNLoadBalancerOrigin2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐOrigin(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_LoadBalancerOriginCreatePayload_loadBalancerOrigin(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: "LoadBalancerOriginCreatePayload", + Object: "LoadBalancerPool", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerOrigin_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancerOrigin_name(ctx, field) - case "target": - return ec.fieldContext_LoadBalancerOrigin_target(ctx, field) - case "portNumber": - return ec.fieldContext_LoadBalancerOrigin_portNumber(ctx, field) - case "active": - return ec.fieldContext_LoadBalancerOrigin_active(ctx, field) - case "poolID": - return ec.fieldContext_LoadBalancerOrigin_poolID(ctx, field) - case "pool": - return ec.fieldContext_LoadBalancerOrigin_pool(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOrigin", field.Name) + return nil, errors.New("field of type LoadBalancerPoolProtocol does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOriginDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerOriginDeletePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOriginDeletePayload_deletedID(ctx, field) +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 } @@ -6884,7 +6037,7 @@ func (ec *executionContext) _LoadBalancerOriginDeletePayload_deletedID(ctx conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeletedID, nil + return obj.OwnerID, nil }) if err != nil { ec.Error(ctx, err) @@ -6901,9 +6054,9 @@ func (ec *executionContext) _LoadBalancerOriginDeletePayload_deletedID(ctx conte return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOriginDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPool_ownerID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOriginDeletePayload", + Object: "LoadBalancerPool", Field: field, IsMethod: false, IsResolver: false, @@ -6914,8 +6067,8 @@ func (ec *executionContext) fieldContext_LoadBalancerOriginDeletePayload_deleted return fc, nil } -func (ec *executionContext) _LoadBalancerOriginEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerOriginEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOriginEdge_node(ctx, field) +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 } @@ -6928,7 +6081,7 @@ func (ec *executionContext) _LoadBalancerOriginEdge_node(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Ports(ctx) }) if err != nil { ec.Error(ctx, err) @@ -6937,46 +6090,44 @@ func (ec *executionContext) _LoadBalancerOriginEdge_node(ctx context.Context, fi if resTmp == nil { return graphql.Null } - res := resTmp.(*generated.Origin) + res := resTmp.([]*generated.Port) fc.Result = res - return ec.marshalOLoadBalancerOrigin2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐOrigin(ctx, field.Selections, res) + return ec.marshalOLoadBalancerPort2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPortᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOriginEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPool_ports(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOriginEdge", + Object: "LoadBalancerPool", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_LoadBalancerOrigin_id(ctx, field) + return ec.fieldContext_LoadBalancerPort_id(ctx, field) case "createdAt": - return ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) + return ec.fieldContext_LoadBalancerPort_createdAt(ctx, field) case "updatedAt": - return ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) + return ec.fieldContext_LoadBalancerPort_updatedAt(ctx, field) + case "number": + return ec.fieldContext_LoadBalancerPort_number(ctx, field) case "name": - return ec.fieldContext_LoadBalancerOrigin_name(ctx, field) - case "target": - return ec.fieldContext_LoadBalancerOrigin_target(ctx, field) - case "portNumber": - return ec.fieldContext_LoadBalancerOrigin_portNumber(ctx, field) - case "active": - return ec.fieldContext_LoadBalancerOrigin_active(ctx, field) - case "poolID": - return ec.fieldContext_LoadBalancerOrigin_poolID(ctx, field) - case "pool": - return ec.fieldContext_LoadBalancerOrigin_pool(ctx, field) + 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) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOrigin", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPort", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerOriginEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerOriginEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOriginEdge_cursor(ctx, field) +func (ec *executionContext) _LoadBalancerPool_origins(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPool_origins(ctx, field) if err != nil { return graphql.Null } @@ -6989,7 +6140,7 @@ func (ec *executionContext) _LoadBalancerOriginEdge_cursor(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Origins(ctx, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerOriginOrder), fc.Args["where"].(*generated.LoadBalancerOriginWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -7001,26 +6152,45 @@ func (ec *executionContext) _LoadBalancerOriginEdge_cursor(ctx context.Context, } return graphql.Null } - res := resTmp.(entgql.Cursor[gidx.PrefixedID]) + res := resTmp.(*generated.LoadBalancerOriginConnection) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNLoadBalancerOriginConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOriginEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPool_origins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOriginEdge", + Object: "LoadBalancerPool", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Cursor does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_LoadBalancerOriginConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_LoadBalancerOriginConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_LoadBalancerOriginConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOriginConnection", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_LoadBalancerPool_origins_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerOriginUpdatePayload_loadBalancerOrigin(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerOriginUpdatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerOriginUpdatePayload_loadBalancerOrigin(ctx, field) +func (ec *executionContext) _LoadBalancerPool_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPool_owner(ctx, field) if err != nil { return graphql.Null } @@ -7033,7 +6203,7 @@ func (ec *executionContext) _LoadBalancerOriginUpdatePayload_loadBalancerOrigin( }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancerOrigin, nil + return ec.resolvers.LoadBalancerPool().Owner(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -7045,46 +6215,36 @@ func (ec *executionContext) _LoadBalancerOriginUpdatePayload_loadBalancerOrigin( } return graphql.Null } - res := resTmp.(*generated.Origin) + res := resTmp.(*ResourceOwner) fc.Result = res - return ec.marshalNLoadBalancerOrigin2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐOrigin(ctx, field.Selections, res) + return ec.marshalNResourceOwner2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐResourceOwner(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerOriginUpdatePayload_loadBalancerOrigin(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPool_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerOriginUpdatePayload", + Object: "LoadBalancerPool", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_LoadBalancerOrigin_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerOrigin_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerOrigin_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancerOrigin_name(ctx, field) - case "target": - return ec.fieldContext_LoadBalancerOrigin_target(ctx, field) - case "portNumber": - return ec.fieldContext_LoadBalancerOrigin_portNumber(ctx, field) - case "active": - return ec.fieldContext_LoadBalancerOrigin_active(ctx, field) - case "poolID": - return ec.fieldContext_LoadBalancerOrigin_poolID(ctx, field) - case "pool": - return ec.fieldContext_LoadBalancerOrigin_pool(ctx, field) + return ec.fieldContext_ResourceOwner_id(ctx, field) + case "loadBalancers": + return ec.fieldContext_ResourceOwner_loadBalancers(ctx, field) + case "loadBalancerPools": + return ec.fieldContext_ResourceOwner_loadBalancerPools(ctx, field) + case "loadBalancersProviders": + return ec.fieldContext_ResourceOwner_loadBalancersProviders(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOrigin", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ResourceOwner", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPool_id(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPool_id(ctx, field) +func (ec *executionContext) _LoadBalancerPoolConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPoolConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPoolConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -7097,38 +6257,41 @@ func (ec *executionContext) _LoadBalancerPool_id(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Edges, 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) + res := resTmp.([]*generated.LoadBalancerPoolEdge) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalOLoadBalancerPoolEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPool_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPoolConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPool", + Object: "LoadBalancerPoolConnection", 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") + switch field.Name { + case "node": + return ec.fieldContext_LoadBalancerPoolEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_LoadBalancerPoolEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPool_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) +func (ec *executionContext) _LoadBalancerPoolConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPoolConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPoolConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -7141,7 +6304,7 @@ func (ec *executionContext) _LoadBalancerPool_createdAt(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -7153,26 +6316,36 @@ func (ec *executionContext) _LoadBalancerPool_createdAt(ctx context.Context, fie } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(entgql.PageInfo[gidx.PrefixedID]) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPool_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPoolConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPool", + Object: "LoadBalancerPoolConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPool_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) +func (ec *executionContext) _LoadBalancerPoolConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPoolConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPoolConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -7185,7 +6358,7 @@ func (ec *executionContext) _LoadBalancerPool_updatedAt(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -7197,26 +6370,26 @@ func (ec *executionContext) _LoadBalancerPool_updatedAt(ctx context.Context, fie } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(int) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPool_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPoolConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPool", + Object: "LoadBalancerPoolConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } 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) _LoadBalancerPoolCreatePayload_loadBalancerPool(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPoolCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPoolCreatePayload_loadBalancerPool(ctx, field) if err != nil { return graphql.Null } @@ -7229,7 +6402,7 @@ 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.LoadBalancerPool, nil }) if err != nil { ec.Error(ctx, err) @@ -7241,26 +6414,46 @@ func (ec *executionContext) _LoadBalancerPool_name(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*generated.Pool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPool2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPool(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_LoadBalancerPoolCreatePayload_loadBalancerPool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPool", + Object: "LoadBalancerPoolCreatePayload", 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") + switch field.Name { + case "id": + return ec.fieldContext_LoadBalancerPool_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerPool_name(ctx, field) + case "protocol": + return ec.fieldContext_LoadBalancerPool_protocol(ctx, field) + case "ownerID": + return ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) + case "ports": + return ec.fieldContext_LoadBalancerPool_ports(ctx, field) + case "origins": + return ec.fieldContext_LoadBalancerPool_origins(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancerPool_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPool", field.Name) }, } 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) _LoadBalancerPoolDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPoolDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPoolDeletePayload_deletedID(ctx, field) if err != nil { return graphql.Null } @@ -7273,38 +6466,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.DeletedID, 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.(*gidx.PrefixedID) fc.Result = res - return ec.marshalNLoadBalancerPoolProtocol2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocol(ctx, field.Selections, res) + return ec.marshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(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_LoadBalancerPoolDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPool", + Object: "LoadBalancerPoolDeletePayload", 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 ID 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) _LoadBalancerPoolEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPoolEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPoolEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -7317,38 +6507,55 @@ 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.Node, 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) + res := resTmp.(*generated.Pool) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalOLoadBalancerPool2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPool(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_LoadBalancerPoolEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPool", + Object: "LoadBalancerPoolEdge", 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") + switch field.Name { + case "id": + return ec.fieldContext_LoadBalancerPool_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerPool_name(ctx, field) + case "protocol": + return ec.fieldContext_LoadBalancerPool_protocol(ctx, field) + case "ownerID": + return ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) + case "ports": + return ec.fieldContext_LoadBalancerPool_ports(ctx, field) + case "origins": + return ec.fieldContext_LoadBalancerPool_origins(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancerPool_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPool", field.Name) }, } 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) _LoadBalancerPoolEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPoolEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPoolEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -7361,53 +6568,38 @@ 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.Cursor, 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.(entgql.Cursor[gidx.PrefixedID]) fc.Result = res - return ec.marshalOLoadBalancerPort2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPortᚄ(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(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_LoadBalancerPoolEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPool", + Object: "LoadBalancerPoolEdge", 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) - case "loadBalancer": - return ec.fieldContext_LoadBalancerPort_loadBalancer(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPort", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPool_origins(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPool_origins(ctx, field) +func (ec *executionContext) _LoadBalancerPoolUpdatePayload_loadBalancerPool(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPoolUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPoolUpdatePayload_loadBalancerPool(ctx, field) if err != nil { return graphql.Null } @@ -7420,7 +6612,7 @@ func (ec *executionContext) _LoadBalancerPool_origins(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.Origins(ctx, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerOriginOrder), fc.Args["where"].(*generated.LoadBalancerOriginWhereInput)) + return obj.LoadBalancerPool, nil }) if err != nil { ec.Error(ctx, err) @@ -7432,45 +6624,46 @@ func (ec *executionContext) _LoadBalancerPool_origins(ctx context.Context, field } return graphql.Null } - res := resTmp.(*generated.LoadBalancerOriginConnection) + res := resTmp.(*generated.Pool) fc.Result = res - return ec.marshalNLoadBalancerOriginConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginConnection(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPool2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPool_origins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPoolUpdatePayload_loadBalancerPool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPool", + Object: "LoadBalancerPoolUpdatePayload", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_LoadBalancerOriginConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_LoadBalancerOriginConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_LoadBalancerOriginConnection_totalCount(ctx, field) + case "id": + return ec.fieldContext_LoadBalancerPool_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerPool_name(ctx, field) + case "protocol": + return ec.fieldContext_LoadBalancerPool_protocol(ctx, field) + case "ownerID": + return ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) + case "ports": + return ec.fieldContext_LoadBalancerPool_ports(ctx, field) + case "origins": + return ec.fieldContext_LoadBalancerPool_origins(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancerPool_owner(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOriginConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPool", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_LoadBalancerPool_origins_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _LoadBalancerPool_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Pool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPool_owner(ctx, field) +func (ec *executionContext) _LoadBalancerPort_id(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPort_id(ctx, field) if err != nil { return graphql.Null } @@ -7483,7 +6676,7 @@ func (ec *executionContext) _LoadBalancerPool_owner(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 ec.resolvers.LoadBalancerPool().Owner(rctx, obj) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -7495,36 +6688,26 @@ func (ec *executionContext) _LoadBalancerPool_owner(ctx context.Context, field g } return graphql.Null } - res := resTmp.(*Owner) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalNOwner2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐOwner(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPool_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPort_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPool", + Object: "LoadBalancerPort", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Owner_id(ctx, field) - case "loadBalancers": - return ec.fieldContext_Owner_loadBalancers(ctx, field) - case "loadBalancerPools": - return ec.fieldContext_Owner_loadBalancerPools(ctx, field) - case "loadBalancersProviders": - return ec.fieldContext_Owner_loadBalancersProviders(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Owner", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPoolConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPoolConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPoolConnection_edges(ctx, field) +func (ec *executionContext) _LoadBalancerPort_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPort_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -7537,41 +6720,38 @@ func (ec *executionContext) _LoadBalancerPoolConnection_edges(ctx context.Contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.CreatedAt, 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.LoadBalancerPoolEdge) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalOLoadBalancerPoolEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolEdge(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPoolConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPort_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPoolConnection", + Object: "LoadBalancerPort", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "node": - return ec.fieldContext_LoadBalancerPoolEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_LoadBalancerPoolEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolEdge", field.Name) + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPoolConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPoolConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPoolConnection_pageInfo(ctx, field) +func (ec *executionContext) _LoadBalancerPort_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPort_updatedAt(ctx, field) if err != nil { return graphql.Null } @@ -7584,7 +6764,7 @@ func (ec *executionContext) _LoadBalancerPoolConnection_pageInfo(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.UpdatedAt, nil }) if err != nil { ec.Error(ctx, err) @@ -7596,36 +6776,26 @@ func (ec *executionContext) _LoadBalancerPoolConnection_pageInfo(ctx context.Con } return graphql.Null } - res := resTmp.(entgql.PageInfo[gidx.PrefixedID]) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPoolConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPort_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPoolConnection", + Object: "LoadBalancerPort", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPoolConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPoolConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPoolConnection_totalCount(ctx, field) +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 { return graphql.Null } @@ -7638,7 +6808,7 @@ func (ec *executionContext) _LoadBalancerPoolConnection_totalCount(ctx context.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Number, nil }) if err != nil { ec.Error(ctx, err) @@ -7655,9 +6825,9 @@ func (ec *executionContext) _LoadBalancerPoolConnection_totalCount(ctx context.C return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPoolConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPort_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPoolConnection", + Object: "LoadBalancerPort", Field: field, IsMethod: false, IsResolver: false, @@ -7668,8 +6838,8 @@ func (ec *executionContext) fieldContext_LoadBalancerPoolConnection_totalCount(c return fc, nil } -func (ec *executionContext) _LoadBalancerPoolCreatePayload_loadBalancerPool(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPoolCreatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPoolCreatePayload_loadBalancerPool(ctx, field) +func (ec *executionContext) _LoadBalancerPort_name(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPort_name(ctx, field) if err != nil { return graphql.Null } @@ -7682,7 +6852,7 @@ func (ec *executionContext) _LoadBalancerPoolCreatePayload_loadBalancerPool(ctx }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancerPool, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -7694,46 +6864,26 @@ func (ec *executionContext) _LoadBalancerPoolCreatePayload_loadBalancerPool(ctx } return graphql.Null } - res := resTmp.(*generated.Pool) + res := resTmp.(string) fc.Result = res - return ec.marshalNLoadBalancerPool2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPoolCreatePayload_loadBalancerPool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPort_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPoolCreatePayload", + Object: "LoadBalancerPort", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerPool_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancerPool_name(ctx, field) - case "protocol": - return ec.fieldContext_LoadBalancerPool_protocol(ctx, field) - case "ownerID": - return ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) - case "ports": - return ec.fieldContext_LoadBalancerPool_ports(ctx, field) - case "origins": - return ec.fieldContext_LoadBalancerPool_origins(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancerPool_owner(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPool", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPoolDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPoolDeletePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPoolDeletePayload_deletedID(ctx, field) +func (ec *executionContext) _LoadBalancerPort_loadBalancerID(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPort_loadBalancerID(ctx, field) if err != nil { return graphql.Null } @@ -7746,23 +6896,26 @@ func (ec *executionContext) _LoadBalancerPoolDeletePayload_deletedID(ctx context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeletedID, nil + return obj.LoadBalancerID, 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) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPoolDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPort_loadBalancerID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPoolDeletePayload", + Object: "LoadBalancerPort", Field: field, IsMethod: false, IsResolver: false, @@ -7773,8 +6926,8 @@ func (ec *executionContext) fieldContext_LoadBalancerPoolDeletePayload_deletedID return fc, nil } -func (ec *executionContext) _LoadBalancerPoolEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPoolEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPoolEdge_node(ctx, field) +func (ec *executionContext) _LoadBalancerPort_pools(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPort_pools(ctx, field) if err != nil { return graphql.Null } @@ -7787,7 +6940,7 @@ func (ec *executionContext) _LoadBalancerPoolEdge_node(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.Node, nil + return obj.Pools(ctx) }) if err != nil { ec.Error(ctx, err) @@ -7796,16 +6949,16 @@ func (ec *executionContext) _LoadBalancerPoolEdge_node(ctx context.Context, fiel if resTmp == nil { return graphql.Null } - res := resTmp.(*generated.Pool) + res := resTmp.([]*generated.Pool) fc.Result = res - return ec.marshalOLoadBalancerPool2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPool(ctx, field.Selections, res) + return ec.marshalOLoadBalancerPool2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPoolᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPoolEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPort_pools(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPoolEdge", + Object: "LoadBalancerPort", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -7834,8 +6987,8 @@ func (ec *executionContext) fieldContext_LoadBalancerPoolEdge_node(ctx context.C return fc, nil } -func (ec *executionContext) _LoadBalancerPoolEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPoolEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPoolEdge_cursor(ctx, field) +func (ec *executionContext) _LoadBalancerPort_loadBalancer(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPort_loadBalancer(ctx, field) if err != nil { return graphql.Null } @@ -7848,7 +7001,7 @@ func (ec *executionContext) _LoadBalancerPoolEdge_cursor(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.LoadBalancer(ctx) }) if err != nil { ec.Error(ctx, err) @@ -7860,26 +7013,44 @@ func (ec *executionContext) _LoadBalancerPoolEdge_cursor(ctx context.Context, fi } return graphql.Null } - res := resTmp.(entgql.Cursor[gidx.PrefixedID]) + res := resTmp.(*generated.LoadBalancer) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancer(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPoolEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPort_loadBalancer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPoolEdge", + Object: "LoadBalancerPort", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Cursor does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _LoadBalancerPoolUpdatePayload_loadBalancerPool(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPoolUpdatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPoolUpdatePayload_loadBalancerPool(ctx, field) + switch field.Name { + case "id": + return ec.fieldContext_LoadBalancer_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancer_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancer_name(ctx, field) + case "ports": + return ec.fieldContext_LoadBalancer_ports(ctx, field) + case "loadBalancerProvider": + return ec.fieldContext_LoadBalancer_loadBalancerProvider(ctx, field) + case "location": + return ec.fieldContext_LoadBalancer_location(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancer_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancer", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _LoadBalancerPortConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPortConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPortConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -7892,58 +7063,41 @@ func (ec *executionContext) _LoadBalancerPoolUpdatePayload_loadBalancerPool(ctx }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancerPool, nil + return obj.Edges, 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.Pool) + res := resTmp.([]*generated.LoadBalancerPortEdge) fc.Result = res - return ec.marshalNLoadBalancerPool2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPool(ctx, field.Selections, res) + return ec.marshalOLoadBalancerPortEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPoolUpdatePayload_loadBalancerPool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPortConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPoolUpdatePayload", + Object: "LoadBalancerPortConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerPool_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancerPool_name(ctx, field) - case "protocol": - return ec.fieldContext_LoadBalancerPool_protocol(ctx, field) - case "ownerID": - return ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) - case "ports": - return ec.fieldContext_LoadBalancerPool_ports(ctx, field) - case "origins": - return ec.fieldContext_LoadBalancerPool_origins(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancerPool_owner(ctx, field) + case "node": + return ec.fieldContext_LoadBalancerPortEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_LoadBalancerPortEdge_cursor(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPool", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPortEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPort_id(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPort_id(ctx, field) +func (ec *executionContext) _LoadBalancerPortConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPortConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPortConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -7956,7 +7110,7 @@ func (ec *executionContext) _LoadBalancerPort_id(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -7968,26 +7122,36 @@ func (ec *executionContext) _LoadBalancerPort_id(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.(entgql.PageInfo[gidx.PrefixedID]) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPort_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPortConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPort", + Object: "LoadBalancerPortConnection", 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") + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPort_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPort_createdAt(ctx, field) +func (ec *executionContext) _LoadBalancerPortConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPortConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPortConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -8000,7 +7164,7 @@ func (ec *executionContext) _LoadBalancerPort_createdAt(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -8012,26 +7176,26 @@ func (ec *executionContext) _LoadBalancerPort_createdAt(ctx context.Context, fie } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(int) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPort_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPortConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPort", + Object: "LoadBalancerPortConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPort_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPort_updatedAt(ctx, field) +func (ec *executionContext) _LoadBalancerPortCreatePayload_loadBalancerPort(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPortCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPortCreatePayload_loadBalancerPort(ctx, field) if err != nil { return graphql.Null } @@ -8044,7 +7208,7 @@ func (ec *executionContext) _LoadBalancerPort_updatedAt(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil + return obj.LoadBalancerPort, nil }) if err != nil { ec.Error(ctx, err) @@ -8056,26 +7220,44 @@ func (ec *executionContext) _LoadBalancerPort_updatedAt(ctx context.Context, fie } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(*generated.Port) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPort2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPort(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPort_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPortCreatePayload_loadBalancerPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPort", + Object: "LoadBalancerPortCreatePayload", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + 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) + case "loadBalancer": + return ec.fieldContext_LoadBalancerPort_loadBalancer(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPort", field.Name) }, } 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) +func (ec *executionContext) _LoadBalancerPortDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPortDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPortDeletePayload_deletedID(ctx, field) if err != nil { return graphql.Null } @@ -8088,7 +7270,7 @@ func (ec *executionContext) _LoadBalancerPort_number(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.Number, nil + return obj.DeletedID, nil }) if err != nil { ec.Error(ctx, err) @@ -8100,26 +7282,26 @@ func (ec *executionContext) _LoadBalancerPort_number(ctx context.Context, field } return graphql.Null } - res := resTmp.(int) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPort_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPortDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPort", + Object: "LoadBalancerPortDeletePayload", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPort_name(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPort_name(ctx, field) +func (ec *executionContext) _LoadBalancerPortEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPortEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPortEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -8132,38 +7314,53 @@ func (ec *executionContext) _LoadBalancerPort_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.Node, 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) + res := resTmp.(*generated.Port) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOLoadBalancerPort2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPort(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPort_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPortEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPort", + Object: "LoadBalancerPortEdge", 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") + 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) + case "loadBalancer": + return ec.fieldContext_LoadBalancerPort_loadBalancer(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPort", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPort_loadBalancerID(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPort_loadBalancerID(ctx, field) +func (ec *executionContext) _LoadBalancerPortEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPortEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPortEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -8176,7 +7373,7 @@ func (ec *executionContext) _LoadBalancerPort_loadBalancerID(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancerID, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -8188,26 +7385,26 @@ func (ec *executionContext) _LoadBalancerPort_loadBalancerID(ctx context.Context } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.(entgql.Cursor[gidx.PrefixedID]) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPort_loadBalancerID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPortEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPort", + Object: "LoadBalancerPortEdge", 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 Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPort_pools(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPort_pools(ctx, field) +func (ec *executionContext) _LoadBalancerPortUpdatePayload_loadBalancerPort(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPortUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerPortUpdatePayload_loadBalancerPort(ctx, field) if err != nil { return graphql.Null } @@ -8220,55 +7417,56 @@ func (ec *executionContext) _LoadBalancerPort_pools(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.Pools(ctx) + return obj.LoadBalancerPort, 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.Pool) + res := resTmp.(*generated.Port) fc.Result = res - return ec.marshalOLoadBalancerPool2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPoolᚄ(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPort2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPort(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPort_pools(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerPortUpdatePayload_loadBalancerPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPort", + Object: "LoadBalancerPortUpdatePayload", 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_LoadBalancerPool_id(ctx, field) + return ec.fieldContext_LoadBalancerPort_id(ctx, field) case "createdAt": - return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) + return ec.fieldContext_LoadBalancerPort_createdAt(ctx, field) case "updatedAt": - return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + return ec.fieldContext_LoadBalancerPort_updatedAt(ctx, field) + case "number": + return ec.fieldContext_LoadBalancerPort_number(ctx, field) case "name": - return ec.fieldContext_LoadBalancerPool_name(ctx, field) - case "protocol": - return ec.fieldContext_LoadBalancerPool_protocol(ctx, field) - case "ownerID": - return ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) - case "ports": - return ec.fieldContext_LoadBalancerPool_ports(ctx, field) - case "origins": - return ec.fieldContext_LoadBalancerPool_origins(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancerPool_owner(ctx, field) + 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) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPool", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPort", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPort_loadBalancer(ctx context.Context, field graphql.CollectedField, obj *generated.Port) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPort_loadBalancer(ctx, field) +func (ec *executionContext) _LoadBalancerProvider_id(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProvider_id(ctx, field) if err != nil { return graphql.Null } @@ -8281,7 +7479,7 @@ func (ec *executionContext) _LoadBalancerPort_loadBalancer(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancer(ctx) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -8293,48 +7491,26 @@ func (ec *executionContext) _LoadBalancerPort_loadBalancer(ctx context.Context, } return graphql.Null } - res := resTmp.(*generated.LoadBalancer) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalNLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancer(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPort_loadBalancer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProvider_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPort", + Object: "LoadBalancerProvider", 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_LoadBalancer_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancer_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancer_name(ctx, field) - case "annotations": - return ec.fieldContext_LoadBalancer_annotations(ctx, field) - case "statuses": - return ec.fieldContext_LoadBalancer_statuses(ctx, field) - case "ports": - return ec.fieldContext_LoadBalancer_ports(ctx, field) - case "loadBalancerProvider": - return ec.fieldContext_LoadBalancer_loadBalancerProvider(ctx, field) - case "location": - return ec.fieldContext_LoadBalancer_location(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancer_owner(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancer", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPortConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPortConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPortConnection_edges(ctx, field) +func (ec *executionContext) _LoadBalancerProvider_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -8347,41 +7523,38 @@ func (ec *executionContext) _LoadBalancerPortConnection_edges(ctx context.Contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.CreatedAt, 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.LoadBalancerPortEdge) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalOLoadBalancerPortEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortEdge(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPortConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProvider_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPortConnection", + Object: "LoadBalancerProvider", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "node": - return ec.fieldContext_LoadBalancerPortEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_LoadBalancerPortEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPortEdge", field.Name) + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPortConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPortConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPortConnection_pageInfo(ctx, field) +func (ec *executionContext) _LoadBalancerProvider_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) if err != nil { return graphql.Null } @@ -8394,7 +7567,7 @@ func (ec *executionContext) _LoadBalancerPortConnection_pageInfo(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.UpdatedAt, nil }) if err != nil { ec.Error(ctx, err) @@ -8406,36 +7579,26 @@ func (ec *executionContext) _LoadBalancerPortConnection_pageInfo(ctx context.Con } return graphql.Null } - res := resTmp.(entgql.PageInfo[gidx.PrefixedID]) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPortConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProvider_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPortConnection", + Object: "LoadBalancerProvider", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPortConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPortConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPortConnection_totalCount(ctx, field) +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 { return graphql.Null } @@ -8448,7 +7611,7 @@ func (ec *executionContext) _LoadBalancerPortConnection_totalCount(ctx context.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -8460,26 +7623,26 @@ func (ec *executionContext) _LoadBalancerPortConnection_totalCount(ctx context.C } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPortConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProvider_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPortConnection", + 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 Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPortCreatePayload_loadBalancerPort(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPortCreatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPortCreatePayload_loadBalancerPort(ctx, field) +func (ec *executionContext) _LoadBalancerProvider_loadBalancers(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProvider_loadBalancers(ctx, field) if err != nil { return graphql.Null } @@ -8492,7 +7655,7 @@ func (ec *executionContext) _LoadBalancerPortCreatePayload_loadBalancerPort(ctx }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancerPort, nil + return obj.LoadBalancers(ctx, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerOrder), fc.Args["where"].(*generated.LoadBalancerWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -8504,44 +7667,45 @@ func (ec *executionContext) _LoadBalancerPortCreatePayload_loadBalancerPort(ctx } return graphql.Null } - res := resTmp.(*generated.Port) + res := resTmp.(*generated.LoadBalancerConnection) fc.Result = res - return ec.marshalNLoadBalancerPort2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPort(ctx, field.Selections, res) + return ec.marshalNLoadBalancerConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPortCreatePayload_loadBalancerPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProvider_loadBalancers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPortCreatePayload", + Object: "LoadBalancerProvider", Field: field, - IsMethod: false, + 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 "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) + case "edges": + return ec.fieldContext_LoadBalancerConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_LoadBalancerConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_LoadBalancerConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPort", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerConnection", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_LoadBalancerProvider_loadBalancers_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerPortDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPortDeletePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPortDeletePayload_deletedID(ctx, field) +func (ec *executionContext) _LoadBalancerProvider_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProvider_owner(ctx, field) if err != nil { return graphql.Null } @@ -8554,7 +7718,7 @@ func (ec *executionContext) _LoadBalancerPortDeletePayload_deletedID(ctx context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeletedID, nil + return ec.resolvers.LoadBalancerProvider().Owner(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8566,26 +7730,36 @@ func (ec *executionContext) _LoadBalancerPortDeletePayload_deletedID(ctx context } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.(*ResourceOwner) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNResourceOwner2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐResourceOwner(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPortDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProvider_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPortDeletePayload", + Object: "LoadBalancerProvider", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_ResourceOwner_id(ctx, field) + case "loadBalancers": + return ec.fieldContext_ResourceOwner_loadBalancers(ctx, field) + case "loadBalancerPools": + return ec.fieldContext_ResourceOwner_loadBalancerPools(ctx, field) + case "loadBalancersProviders": + return ec.fieldContext_ResourceOwner_loadBalancersProviders(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ResourceOwner", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPortEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPortEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPortEdge_node(ctx, field) +func (ec *executionContext) _LoadBalancerProviderConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerProviderConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProviderConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -8598,7 +7772,7 @@ func (ec *executionContext) _LoadBalancerPortEdge_node(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.Node, nil + return obj.Edges, nil }) if err != nil { ec.Error(ctx, err) @@ -8607,44 +7781,32 @@ func (ec *executionContext) _LoadBalancerPortEdge_node(ctx context.Context, fiel if resTmp == nil { return graphql.Null } - res := resTmp.(*generated.Port) + res := resTmp.([]*generated.LoadBalancerProviderEdge) fc.Result = res - return ec.marshalOLoadBalancerPort2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPort(ctx, field.Selections, res) + return ec.marshalOLoadBalancerProviderEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPortEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProviderConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPortEdge", + Object: "LoadBalancerProviderConnection", Field: field, 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) - case "loadBalancer": - return ec.fieldContext_LoadBalancerPort_loadBalancer(ctx, field) + case "node": + return ec.fieldContext_LoadBalancerProviderEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_LoadBalancerProviderEdge_cursor(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPort", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProviderEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPortEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerPortEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPortEdge_cursor(ctx, field) +func (ec *executionContext) _LoadBalancerProviderConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerProviderConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProviderConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -8657,7 +7819,7 @@ func (ec *executionContext) _LoadBalancerPortEdge_cursor(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -8669,26 +7831,36 @@ func (ec *executionContext) _LoadBalancerPortEdge_cursor(ctx context.Context, fi } return graphql.Null } - res := resTmp.(entgql.Cursor[gidx.PrefixedID]) + res := resTmp.(entgql.PageInfo[gidx.PrefixedID]) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPortEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProviderConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPortEdge", + Object: "LoadBalancerProviderConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Cursor does not have child fields") + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerPortUpdatePayload_loadBalancerPort(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerPortUpdatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerPortUpdatePayload_loadBalancerPort(ctx, field) +func (ec *executionContext) _LoadBalancerProviderConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerProviderConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProviderConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -8701,7 +7873,7 @@ func (ec *executionContext) _LoadBalancerPortUpdatePayload_loadBalancerPort(ctx }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancerPort, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -8713,44 +7885,26 @@ func (ec *executionContext) _LoadBalancerPortUpdatePayload_loadBalancerPort(ctx } return graphql.Null } - res := resTmp.(*generated.Port) + res := resTmp.(int) fc.Result = res - return ec.marshalNLoadBalancerPort2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPort(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerPortUpdatePayload_loadBalancerPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProviderConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerPortUpdatePayload", + Object: "LoadBalancerProviderConnection", Field: field, 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) - case "loadBalancer": - return ec.fieldContext_LoadBalancerPort_loadBalancer(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPort", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerProvider_id(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProvider_id(ctx, field) +func (ec *executionContext) _LoadBalancerProviderCreatePayload_loadBalancerProvider(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerProviderCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProviderCreatePayload_loadBalancerProvider(ctx, field) if err != nil { return graphql.Null } @@ -8763,7 +7917,7 @@ func (ec *executionContext) _LoadBalancerProvider_id(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.ID, nil + return obj.LoadBalancerProvider, nil }) if err != nil { ec.Error(ctx, err) @@ -8775,26 +7929,40 @@ func (ec *executionContext) _LoadBalancerProvider_id(ctx context.Context, field } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.(*generated.Provider) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNLoadBalancerProvider2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐProvider(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProvider_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProviderCreatePayload_loadBalancerProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProvider", + Object: "LoadBalancerProviderCreatePayload", 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") + switch field.Name { + case "id": + return ec.fieldContext_LoadBalancerProvider_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerProvider_name(ctx, field) + case "loadBalancers": + return ec.fieldContext_LoadBalancerProvider_loadBalancers(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancerProvider_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProvider", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerProvider_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) +func (ec *executionContext) _LoadBalancerProviderDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerProviderDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProviderDeletePayload_deletedID(ctx, field) if err != nil { return graphql.Null } @@ -8807,7 +7975,7 @@ func (ec *executionContext) _LoadBalancerProvider_createdAt(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + return obj.DeletedID, nil }) if err != nil { ec.Error(ctx, err) @@ -8819,26 +7987,26 @@ func (ec *executionContext) _LoadBalancerProvider_createdAt(ctx context.Context, } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProvider_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProviderDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProvider", + Object: "LoadBalancerProviderDeletePayload", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerProvider_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) +func (ec *executionContext) _LoadBalancerProviderEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerProviderEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProviderEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -8851,38 +8019,49 @@ func (ec *executionContext) _LoadBalancerProvider_updatedAt(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil + return obj.Node, 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.(time.Time) + res := resTmp.(*generated.Provider) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalOLoadBalancerProvider2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐProvider(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProvider_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProviderEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProvider", + Object: "LoadBalancerProviderEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_LoadBalancerProvider_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerProvider_name(ctx, field) + case "loadBalancers": + return ec.fieldContext_LoadBalancerProvider_loadBalancers(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancerProvider_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProvider", field.Name) }, } 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) +func (ec *executionContext) _LoadBalancerProviderEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerProviderEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProviderEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -8895,7 +8074,7 @@ func (ec *executionContext) _LoadBalancerProvider_name(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.Name, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -8907,26 +8086,26 @@ func (ec *executionContext) _LoadBalancerProvider_name(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entgql.Cursor[gidx.PrefixedID]) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProvider_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProviderEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProvider", + Object: "LoadBalancerProviderEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerProvider_loadBalancers(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProvider_loadBalancers(ctx, field) +func (ec *executionContext) _LoadBalancerProviderUpdatePayload_loadBalancerProvider(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerProviderUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerProviderUpdatePayload_loadBalancerProvider(ctx, field) if err != nil { return graphql.Null } @@ -8939,7 +8118,7 @@ func (ec *executionContext) _LoadBalancerProvider_loadBalancers(ctx context.Cont }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancers(ctx, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerOrder), fc.Args["where"].(*generated.LoadBalancerWhereInput)) + return obj.LoadBalancerProvider, nil }) if err != nil { ec.Error(ctx, err) @@ -8951,45 +8130,40 @@ func (ec *executionContext) _LoadBalancerProvider_loadBalancers(ctx context.Cont } return graphql.Null } - res := resTmp.(*generated.LoadBalancerConnection) + res := resTmp.(*generated.Provider) fc.Result = res - return ec.marshalNLoadBalancerConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerConnection(ctx, field.Selections, res) + return ec.marshalNLoadBalancerProvider2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐProvider(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProvider_loadBalancers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerProviderUpdatePayload_loadBalancerProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProvider", + Object: "LoadBalancerProviderUpdatePayload", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_LoadBalancerConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_LoadBalancerConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_LoadBalancerConnection_totalCount(ctx, field) + case "id": + return ec.fieldContext_LoadBalancerProvider_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerProvider_name(ctx, field) + case "loadBalancers": + return ec.fieldContext_LoadBalancerProvider_loadBalancers(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancerProvider_owner(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProvider", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_LoadBalancerProvider_loadBalancers_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _LoadBalancerProvider_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Provider) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProvider_owner(ctx, field) +func (ec *executionContext) _LoadBalancerUpdatePayload_loadBalancer(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LoadBalancerUpdatePayload_loadBalancer(ctx, field) if err != nil { return graphql.Null } @@ -9002,7 +8176,7 @@ func (ec *executionContext) _LoadBalancerProvider_owner(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.LoadBalancerProvider().Owner(rctx, obj) + return obj.LoadBalancer, nil }) if err != nil { ec.Error(ctx, err) @@ -9014,36 +8188,44 @@ func (ec *executionContext) _LoadBalancerProvider_owner(ctx context.Context, fie } return graphql.Null } - res := resTmp.(*Owner) + res := resTmp.(*generated.LoadBalancer) fc.Result = res - return ec.marshalNOwner2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐOwner(ctx, field.Selections, res) + return ec.marshalNLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancer(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProvider_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_LoadBalancerUpdatePayload_loadBalancer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProvider", + Object: "LoadBalancerUpdatePayload", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_Owner_id(ctx, field) - case "loadBalancers": - return ec.fieldContext_Owner_loadBalancers(ctx, field) - case "loadBalancerPools": - return ec.fieldContext_Owner_loadBalancerPools(ctx, field) - case "loadBalancersProviders": - return ec.fieldContext_Owner_loadBalancersProviders(ctx, field) + return ec.fieldContext_LoadBalancer_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancer_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancer_name(ctx, field) + case "ports": + return ec.fieldContext_LoadBalancer_ports(ctx, field) + case "loadBalancerProvider": + return ec.fieldContext_LoadBalancer_loadBalancerProvider(ctx, field) + case "location": + return ec.fieldContext_LoadBalancer_location(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancer_owner(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Owner", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancer", field.Name) }, } return fc, nil } -func (ec *executionContext) _LoadBalancerProviderConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerProviderConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProviderConnection_edges(ctx, field) +func (ec *executionContext) _Location_id(ctx context.Context, field graphql.CollectedField, obj *Location) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Location_id(ctx, field) if err != nil { return graphql.Null } @@ -9056,41 +8238,38 @@ func (ec *executionContext) _LoadBalancerProviderConnection_edges(ctx context.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.ID, 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.LoadBalancerProviderEdge) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalOLoadBalancerProviderEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderEdge(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProviderConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Location_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProviderConnection", + Object: "Location", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "node": - return ec.fieldContext_LoadBalancerProviderEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_LoadBalancerProviderEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProviderEdge", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerProviderConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerProviderConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProviderConnection_pageInfo(ctx, field) +func (ec *executionContext) _Location_loadBalancers(ctx context.Context, field graphql.CollectedField, obj *Location) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Location_loadBalancers(ctx, field) if err != nil { return graphql.Null } @@ -9103,7 +8282,7 @@ func (ec *executionContext) _LoadBalancerProviderConnection_pageInfo(ctx context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return ec.resolvers.Location().LoadBalancers(rctx, obj, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerOrder), fc.Args["where"].(*generated.LoadBalancerWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9115,36 +8294,45 @@ func (ec *executionContext) _LoadBalancerProviderConnection_pageInfo(ctx context } return graphql.Null } - res := resTmp.(entgql.PageInfo[gidx.PrefixedID]) + res := resTmp.(*generated.LoadBalancerConnection) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNLoadBalancerConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProviderConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Location_loadBalancers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProviderConnection", + Object: "Location", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "edges": + return ec.fieldContext_LoadBalancerConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_LoadBalancerConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_LoadBalancerConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerConnection", field.Name) }, } - return fc, nil -} - -func (ec *executionContext) _LoadBalancerProviderConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerProviderConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProviderConnection_totalCount(ctx, field) + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Location_loadBalancers_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_loadBalancerOriginCreate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerOriginCreate(ctx, field) if err != nil { return graphql.Null } @@ -9157,7 +8345,7 @@ func (ec *executionContext) _LoadBalancerProviderConnection_totalCount(ctx conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return ec.resolvers.Mutation().LoadBalancerOriginCreate(rctx, fc.Args["input"].(generated.CreateLoadBalancerOriginInput)) }) if err != nil { ec.Error(ctx, err) @@ -9169,26 +8357,41 @@ func (ec *executionContext) _LoadBalancerProviderConnection_totalCount(ctx conte } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*LoadBalancerOriginCreatePayload) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNLoadBalancerOriginCreatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerOriginCreatePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProviderConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerOriginCreate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProviderConnection", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "loadBalancerOrigin": + return ec.fieldContext_LoadBalancerOriginCreatePayload_loadBalancerOrigin(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOriginCreatePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerOriginCreate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerProviderCreatePayload_loadBalancerProvider(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerProviderCreatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProviderCreatePayload_loadBalancerProvider(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerOriginUpdate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerOriginUpdate(ctx, field) if err != nil { return graphql.Null } @@ -9201,7 +8404,7 @@ func (ec *executionContext) _LoadBalancerProviderCreatePayload_loadBalancerProvi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancerProvider, nil + return ec.resolvers.Mutation().LoadBalancerOriginUpdate(rctx, fc.Args["id"].(gidx.PrefixedID), fc.Args["input"].(generated.UpdateLoadBalancerOriginInput)) }) if err != nil { ec.Error(ctx, err) @@ -9213,40 +8416,41 @@ func (ec *executionContext) _LoadBalancerProviderCreatePayload_loadBalancerProvi } return graphql.Null } - res := resTmp.(*generated.Provider) + res := resTmp.(*LoadBalancerOriginUpdatePayload) fc.Result = res - return ec.marshalNLoadBalancerProvider2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐProvider(ctx, field.Selections, res) + return ec.marshalNLoadBalancerOriginUpdatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerOriginUpdatePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProviderCreatePayload_loadBalancerProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerOriginUpdate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProviderCreatePayload", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerProvider_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancerProvider_name(ctx, field) - case "loadBalancers": - return ec.fieldContext_LoadBalancerProvider_loadBalancers(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancerProvider_owner(ctx, field) + case "loadBalancerOrigin": + return ec.fieldContext_LoadBalancerOriginUpdatePayload_loadBalancerOrigin(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProvider", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOriginUpdatePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerOriginUpdate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerProviderDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerProviderDeletePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProviderDeletePayload_deletedID(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerOriginDelete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerOriginDelete(ctx, field) if err != nil { return graphql.Null } @@ -9259,7 +8463,7 @@ func (ec *executionContext) _LoadBalancerProviderDeletePayload_deletedID(ctx con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeletedID, nil + return ec.resolvers.Mutation().LoadBalancerOriginDelete(rctx, fc.Args["id"].(gidx.PrefixedID)) }) if err != nil { ec.Error(ctx, err) @@ -9271,26 +8475,41 @@ func (ec *executionContext) _LoadBalancerProviderDeletePayload_deletedID(ctx con } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.(*LoadBalancerOriginDeletePayload) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNLoadBalancerOriginDeletePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerOriginDeletePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProviderDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerOriginDelete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProviderDeletePayload", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + switch field.Name { + case "deletedID": + return ec.fieldContext_LoadBalancerOriginDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOriginDeletePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerOriginDelete_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerProviderEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerProviderEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProviderEdge_node(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerCreate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerCreate(ctx, field) if err != nil { return graphql.Null } @@ -9303,49 +8522,53 @@ func (ec *executionContext) _LoadBalancerProviderEdge_node(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return ec.resolvers.Mutation().LoadBalancerCreate(rctx, fc.Args["input"].(generated.CreateLoadBalancerInput)) }) 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.Provider) + res := resTmp.(*LoadBalancerCreatePayload) fc.Result = res - return ec.marshalOLoadBalancerProvider2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐProvider(ctx, field.Selections, res) + return ec.marshalNLoadBalancerCreatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerCreatePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProviderEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerCreate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProviderEdge", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerProvider_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancerProvider_name(ctx, field) - case "loadBalancers": - return ec.fieldContext_LoadBalancerProvider_loadBalancers(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancerProvider_owner(ctx, field) + case "loadBalancer": + return ec.fieldContext_LoadBalancerCreatePayload_loadBalancer(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProvider", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerCreatePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerCreate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerProviderEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerProviderEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProviderEdge_cursor(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerUpdate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerUpdate(ctx, field) if err != nil { return graphql.Null } @@ -9358,7 +8581,7 @@ func (ec *executionContext) _LoadBalancerProviderEdge_cursor(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return ec.resolvers.Mutation().LoadBalancerUpdate(rctx, fc.Args["id"].(gidx.PrefixedID), fc.Args["input"].(generated.UpdateLoadBalancerInput)) }) if err != nil { ec.Error(ctx, err) @@ -9370,26 +8593,41 @@ func (ec *executionContext) _LoadBalancerProviderEdge_cursor(ctx context.Context } return graphql.Null } - res := resTmp.(entgql.Cursor[gidx.PrefixedID]) + res := resTmp.(*LoadBalancerUpdatePayload) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNLoadBalancerUpdatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerUpdatePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProviderEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerUpdate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProviderEdge", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Cursor does not have child fields") + switch field.Name { + case "loadBalancer": + return ec.fieldContext_LoadBalancerUpdatePayload_loadBalancer(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerUpdatePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerUpdate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerProviderUpdatePayload_loadBalancerProvider(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerProviderUpdatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerProviderUpdatePayload_loadBalancerProvider(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerDelete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerDelete(ctx, field) if err != nil { return graphql.Null } @@ -9402,7 +8640,7 @@ func (ec *executionContext) _LoadBalancerProviderUpdatePayload_loadBalancerProvi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancerProvider, nil + return ec.resolvers.Mutation().LoadBalancerDelete(rctx, fc.Args["id"].(gidx.PrefixedID)) }) if err != nil { ec.Error(ctx, err) @@ -9414,40 +8652,41 @@ func (ec *executionContext) _LoadBalancerProviderUpdatePayload_loadBalancerProvi } return graphql.Null } - res := resTmp.(*generated.Provider) + res := resTmp.(*LoadBalancerDeletePayload) fc.Result = res - return ec.marshalNLoadBalancerProvider2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐProvider(ctx, field.Selections, res) + return ec.marshalNLoadBalancerDeletePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerDeletePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerProviderUpdatePayload_loadBalancerProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerDelete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerProviderUpdatePayload", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerProvider_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancerProvider_name(ctx, field) - case "loadBalancers": - return ec.fieldContext_LoadBalancerProvider_loadBalancers(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancerProvider_owner(ctx, field) + case "deletedID": + return ec.fieldContext_LoadBalancerDeletePayload_deletedID(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProvider", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerDeletePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerDelete_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerStatus_id(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerStatus_id(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerPoolCreate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerPoolCreate(ctx, field) if err != nil { return graphql.Null } @@ -9460,7 +8699,7 @@ func (ec *executionContext) _LoadBalancerStatus_id(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.ID, nil + return ec.resolvers.Mutation().LoadBalancerPoolCreate(rctx, fc.Args["input"].(generated.CreateLoadBalancerPoolInput)) }) if err != nil { ec.Error(ctx, err) @@ -9472,26 +8711,41 @@ func (ec *executionContext) _LoadBalancerStatus_id(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.(*LoadBalancerPoolCreatePayload) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPoolCreatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPoolCreatePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerStatus_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerPoolCreate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerStatus", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + switch field.Name { + case "loadBalancerPool": + return ec.fieldContext_LoadBalancerPoolCreatePayload_loadBalancerPool(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolCreatePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerPoolCreate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerStatus_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerStatus_createdAt(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerPoolUpdate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerPoolUpdate(ctx, field) if err != nil { return graphql.Null } @@ -9504,7 +8758,7 @@ func (ec *executionContext) _LoadBalancerStatus_createdAt(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + return ec.resolvers.Mutation().LoadBalancerPoolUpdate(rctx, fc.Args["id"].(gidx.PrefixedID), fc.Args["input"].(generated.UpdateLoadBalancerPoolInput)) }) if err != nil { ec.Error(ctx, err) @@ -9516,26 +8770,41 @@ func (ec *executionContext) _LoadBalancerStatus_createdAt(ctx context.Context, f } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(*LoadBalancerPoolUpdatePayload) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPoolUpdatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPoolUpdatePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerStatus_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerPoolUpdate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerStatus", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "loadBalancerPool": + return ec.fieldContext_LoadBalancerPoolUpdatePayload_loadBalancerPool(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolUpdatePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerPoolUpdate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerStatus_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerStatus_updatedAt(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerPoolDelete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerPoolDelete(ctx, field) if err != nil { return graphql.Null } @@ -9548,7 +8817,7 @@ func (ec *executionContext) _LoadBalancerStatus_updatedAt(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil + return ec.resolvers.Mutation().LoadBalancerPoolDelete(rctx, fc.Args["id"].(gidx.PrefixedID)) }) if err != nil { ec.Error(ctx, err) @@ -9560,26 +8829,41 @@ func (ec *executionContext) _LoadBalancerStatus_updatedAt(ctx context.Context, f } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(*LoadBalancerPoolDeletePayload) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPoolDeletePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPoolDeletePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerStatus_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerPoolDelete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerStatus", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "deletedID": + return ec.fieldContext_LoadBalancerPoolDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolDeletePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerPoolDelete_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerStatus_loadBalancerID(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerStatus_loadBalancerID(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerPortCreate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerPortCreate(ctx, field) if err != nil { return graphql.Null } @@ -9592,7 +8876,7 @@ func (ec *executionContext) _LoadBalancerStatus_loadBalancerID(ctx context.Conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancerID, nil + return ec.resolvers.Mutation().LoadBalancerPortCreate(rctx, fc.Args["input"].(generated.CreateLoadBalancerPortInput)) }) if err != nil { ec.Error(ctx, err) @@ -9604,26 +8888,41 @@ func (ec *executionContext) _LoadBalancerStatus_loadBalancerID(ctx context.Conte } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.(*LoadBalancerPortCreatePayload) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPortCreatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPortCreatePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerStatus_loadBalancerID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerPortCreate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerStatus", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + switch field.Name { + case "loadBalancerPort": + return ec.fieldContext_LoadBalancerPortCreatePayload_loadBalancerPort(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPortCreatePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerPortCreate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerStatus_source(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerStatus_source(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerPortUpdate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerPortUpdate(ctx, field) if err != nil { return graphql.Null } @@ -9636,7 +8935,7 @@ func (ec *executionContext) _LoadBalancerStatus_source(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.Source, nil + return ec.resolvers.Mutation().LoadBalancerPortUpdate(rctx, fc.Args["id"].(gidx.PrefixedID), fc.Args["input"].(generated.UpdateLoadBalancerPortInput)) }) if err != nil { ec.Error(ctx, err) @@ -9648,26 +8947,41 @@ func (ec *executionContext) _LoadBalancerStatus_source(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*LoadBalancerPortUpdatePayload) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPortUpdatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPortUpdatePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerStatus_source(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerPortUpdate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerStatus", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "loadBalancerPort": + return ec.fieldContext_LoadBalancerPortUpdatePayload_loadBalancerPort(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPortUpdatePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerPortUpdate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerStatus_loadBalancer(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerStatus_loadBalancer(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerPortDelete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerPortDelete(ctx, field) if err != nil { return graphql.Null } @@ -9680,7 +8994,7 @@ func (ec *executionContext) _LoadBalancerStatus_loadBalancer(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancer(ctx) + return ec.resolvers.Mutation().LoadBalancerPortDelete(rctx, fc.Args["id"].(gidx.PrefixedID)) }) if err != nil { ec.Error(ctx, err) @@ -9692,48 +9006,41 @@ func (ec *executionContext) _LoadBalancerStatus_loadBalancer(ctx context.Context } return graphql.Null } - res := resTmp.(*generated.LoadBalancer) + res := resTmp.(*LoadBalancerPortDeletePayload) fc.Result = res - return ec.marshalNLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancer(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPortDeletePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPortDeletePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerStatus_loadBalancer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerPortDelete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerStatus", + Object: "Mutation", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_LoadBalancer_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancer_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancer_name(ctx, field) - case "annotations": - return ec.fieldContext_LoadBalancer_annotations(ctx, field) - case "statuses": - return ec.fieldContext_LoadBalancer_statuses(ctx, field) - case "ports": - return ec.fieldContext_LoadBalancer_ports(ctx, field) - case "loadBalancerProvider": - return ec.fieldContext_LoadBalancer_loadBalancerProvider(ctx, field) - case "location": - return ec.fieldContext_LoadBalancer_location(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancer_owner(ctx, field) + case "deletedID": + return ec.fieldContext_LoadBalancerPortDeletePayload_deletedID(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancer", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPortDeletePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerPortDelete_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerStatusConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerStatusConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerStatusConnection_edges(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerProviderCreate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerProviderCreate(ctx, field) if err != nil { return graphql.Null } @@ -9746,41 +9053,53 @@ func (ec *executionContext) _LoadBalancerStatusConnection_edges(ctx context.Cont }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return ec.resolvers.Mutation().LoadBalancerProviderCreate(rctx, fc.Args["input"].(generated.CreateLoadBalancerProviderInput)) }) 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.LoadBalancerStatusEdge) + res := resTmp.(*LoadBalancerProviderCreatePayload) fc.Result = res - return ec.marshalOLoadBalancerStatusEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusEdge(ctx, field.Selections, res) + return ec.marshalNLoadBalancerProviderCreatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerProviderCreatePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerStatusConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerProviderCreate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerStatusConnection", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "node": - return ec.fieldContext_LoadBalancerStatusEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_LoadBalancerStatusEdge_cursor(ctx, field) + case "loadBalancerProvider": + return ec.fieldContext_LoadBalancerProviderCreatePayload_loadBalancerProvider(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerStatusEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProviderCreatePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerProviderCreate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerStatusConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerStatusConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerStatusConnection_pageInfo(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerProviderUpdate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerProviderUpdate(ctx, field) if err != nil { return graphql.Null } @@ -9793,7 +9112,7 @@ func (ec *executionContext) _LoadBalancerStatusConnection_pageInfo(ctx context.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return ec.resolvers.Mutation().LoadBalancerProviderUpdate(rctx, fc.Args["id"].(gidx.PrefixedID), fc.Args["input"].(generated.UpdateLoadBalancerProviderInput)) }) if err != nil { ec.Error(ctx, err) @@ -9805,36 +9124,41 @@ func (ec *executionContext) _LoadBalancerStatusConnection_pageInfo(ctx context.C } return graphql.Null } - res := resTmp.(entgql.PageInfo[gidx.PrefixedID]) + res := resTmp.(*LoadBalancerProviderUpdatePayload) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNLoadBalancerProviderUpdatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerProviderUpdatePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerStatusConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerProviderUpdate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerStatusConnection", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "loadBalancerProvider": + return ec.fieldContext_LoadBalancerProviderUpdatePayload_loadBalancerProvider(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProviderUpdatePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerProviderUpdate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerStatusConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerStatusConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerStatusConnection_totalCount(ctx, field) +func (ec *executionContext) _Mutation_loadBalancerProviderDelete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_loadBalancerProviderDelete(ctx, field) if err != nil { return graphql.Null } @@ -9847,7 +9171,7 @@ func (ec *executionContext) _LoadBalancerStatusConnection_totalCount(ctx context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return ec.resolvers.Mutation().LoadBalancerProviderDelete(rctx, fc.Args["id"].(gidx.PrefixedID)) }) if err != nil { ec.Error(ctx, err) @@ -9859,26 +9183,41 @@ func (ec *executionContext) _LoadBalancerStatusConnection_totalCount(ctx context } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*LoadBalancerProviderDeletePayload) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNLoadBalancerProviderDeletePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerProviderDeletePayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerStatusConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_loadBalancerProviderDelete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerStatusConnection", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "deletedID": + return ec.fieldContext_LoadBalancerProviderDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProviderDeletePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_loadBalancerProviderDelete_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _LoadBalancerStatusEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerStatusEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerStatusEdge_node(ctx, field) +func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[gidx.PrefixedID]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) if err != nil { return graphql.Null } @@ -9891,49 +9230,38 @@ func (ec *executionContext) _LoadBalancerStatusEdge_node(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.HasNextPage, 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.LoadBalancerStatus) + res := resTmp.(bool) fc.Result = res - return ec.marshalOLoadBalancerStatus2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatus(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerStatusEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerStatusEdge", + Object: "PageInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerStatus_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerStatus_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerStatus_updatedAt(ctx, field) - case "loadBalancerID": - return ec.fieldContext_LoadBalancerStatus_loadBalancerID(ctx, field) - case "source": - return ec.fieldContext_LoadBalancerStatus_source(ctx, field) - case "loadBalancer": - return ec.fieldContext_LoadBalancerStatus_loadBalancer(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerStatus", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerStatusEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.LoadBalancerStatusEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerStatusEdge_cursor(ctx, field) +func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[gidx.PrefixedID]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) if err != nil { return graphql.Null } @@ -9946,7 +9274,7 @@ func (ec *executionContext) _LoadBalancerStatusEdge_cursor(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.HasPreviousPage, nil }) if err != nil { ec.Error(ctx, err) @@ -9958,26 +9286,26 @@ func (ec *executionContext) _LoadBalancerStatusEdge_cursor(ctx context.Context, } return graphql.Null } - res := resTmp.(entgql.Cursor[gidx.PrefixedID]) + res := resTmp.(bool) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerStatusEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerStatusEdge", + Object: "PageInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Cursor does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _LoadBalancerUpdatePayload_loadBalancer(ctx context.Context, field graphql.CollectedField, obj *LoadBalancerUpdatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LoadBalancerUpdatePayload_loadBalancer(ctx, field) +func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[gidx.PrefixedID]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) if err != nil { return graphql.Null } @@ -9990,60 +9318,35 @@ func (ec *executionContext) _LoadBalancerUpdatePayload_loadBalancer(ctx context. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LoadBalancer, nil + return obj.StartCursor, 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.LoadBalancer) + res := resTmp.(*entgql.Cursor[gidx.PrefixedID]) fc.Result = res - return ec.marshalNLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancer(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_LoadBalancerUpdatePayload_loadBalancer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_startCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "LoadBalancerUpdatePayload", + Object: "PageInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancer_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancer_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancer_name(ctx, field) - case "annotations": - return ec.fieldContext_LoadBalancer_annotations(ctx, field) - case "statuses": - return ec.fieldContext_LoadBalancer_statuses(ctx, field) - case "ports": - return ec.fieldContext_LoadBalancer_ports(ctx, field) - case "loadBalancerProvider": - return ec.fieldContext_LoadBalancer_loadBalancerProvider(ctx, field) - case "location": - return ec.fieldContext_LoadBalancer_location(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancer_owner(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancer", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Location_id(ctx context.Context, field graphql.CollectedField, obj *Location) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Location_id(ctx, field) +func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[gidx.PrefixedID]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) if err != nil { return graphql.Null } @@ -10056,38 +9359,35 @@ func (ec *executionContext) _Location_id(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.EndCursor, 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) + res := resTmp.(*entgql.Cursor[gidx.PrefixedID]) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Location_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_endCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Location", + Object: "PageInfo", 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 Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Location_loadBalancers(ctx context.Context, field graphql.CollectedField, obj *Location) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Location_loadBalancers(ctx, field) +func (ec *executionContext) _Query_loadBalancerPools(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_loadBalancerPools(ctx, field) if err != nil { return graphql.Null } @@ -10100,7 +9400,7 @@ func (ec *executionContext) _Location_loadBalancers(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 ec.resolvers.Location().LoadBalancers(rctx, obj, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerOrder), fc.Args["where"].(*generated.LoadBalancerWhereInput)) + return ec.resolvers.Query().LoadBalancerPools(rctx, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerPoolOrder), fc.Args["where"].(*generated.LoadBalancerPoolWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10112,27 +9412,27 @@ func (ec *executionContext) _Location_loadBalancers(ctx context.Context, field g } return graphql.Null } - res := resTmp.(*generated.LoadBalancerConnection) + res := resTmp.(*generated.LoadBalancerPoolConnection) fc.Result = res - return ec.marshalNLoadBalancerConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerConnection(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPoolConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Location_loadBalancers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_loadBalancerPools(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Location", + Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": - return ec.fieldContext_LoadBalancerConnection_edges(ctx, field) + return ec.fieldContext_LoadBalancerPoolConnection_edges(ctx, field) case "pageInfo": - return ec.fieldContext_LoadBalancerConnection_pageInfo(ctx, field) + return ec.fieldContext_LoadBalancerPoolConnection_pageInfo(ctx, field) case "totalCount": - return ec.fieldContext_LoadBalancerConnection_totalCount(ctx, field) + return ec.fieldContext_LoadBalancerPoolConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolConnection", field.Name) }, } defer func() { @@ -10142,15 +9442,15 @@ func (ec *executionContext) fieldContext_Location_loadBalancers(ctx context.Cont } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Location_loadBalancers_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_loadBalancerPools_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerCreate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerCreate(ctx, field) +func (ec *executionContext) _Query_loadBalancer(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_loadBalancer(ctx, field) if err != nil { return graphql.Null } @@ -10163,7 +9463,7 @@ func (ec *executionContext) _Mutation_loadBalancerCreate(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerCreate(rctx, fc.Args["input"].(generated.CreateLoadBalancerInput)) + return ec.resolvers.Query().LoadBalancer(rctx, fc.Args["id"].(gidx.PrefixedID)) }) if err != nil { ec.Error(ctx, err) @@ -10175,23 +9475,37 @@ func (ec *executionContext) _Mutation_loadBalancerCreate(ctx context.Context, fi } return graphql.Null } - res := resTmp.(*LoadBalancerCreatePayload) + res := resTmp.(*generated.LoadBalancer) fc.Result = res - return ec.marshalNLoadBalancerCreatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerCreatePayload(ctx, field.Selections, res) + return ec.marshalNLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancer(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerCreate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_loadBalancer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "loadBalancer": - return ec.fieldContext_LoadBalancerCreatePayload_loadBalancer(ctx, field) + case "id": + return ec.fieldContext_LoadBalancer_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancer_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancer_name(ctx, field) + case "ports": + return ec.fieldContext_LoadBalancer_ports(ctx, field) + case "loadBalancerProvider": + return ec.fieldContext_LoadBalancer_loadBalancerProvider(ctx, field) + case "location": + return ec.fieldContext_LoadBalancer_location(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancer_owner(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerCreatePayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancer", field.Name) }, } defer func() { @@ -10201,15 +9515,15 @@ func (ec *executionContext) fieldContext_Mutation_loadBalancerCreate(ctx context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerCreate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_loadBalancer_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerUpdate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerUpdate(ctx, field) +func (ec *executionContext) _Query_loadBalancerPool(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_loadBalancerPool(ctx, field) if err != nil { return graphql.Null } @@ -10222,7 +9536,7 @@ func (ec *executionContext) _Mutation_loadBalancerUpdate(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerUpdate(rctx, fc.Args["id"].(gidx.PrefixedID), fc.Args["input"].(generated.UpdateLoadBalancerInput)) + return ec.resolvers.Query().LoadBalancerPool(rctx, fc.Args["id"].(gidx.PrefixedID)) }) if err != nil { ec.Error(ctx, err) @@ -10234,23 +9548,39 @@ func (ec *executionContext) _Mutation_loadBalancerUpdate(ctx context.Context, fi } return graphql.Null } - res := resTmp.(*LoadBalancerUpdatePayload) + res := resTmp.(*generated.Pool) fc.Result = res - return ec.marshalNLoadBalancerUpdatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerUpdatePayload(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPool2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerUpdate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_loadBalancerPool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "loadBalancer": - return ec.fieldContext_LoadBalancerUpdatePayload_loadBalancer(ctx, field) + case "id": + return ec.fieldContext_LoadBalancerPool_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerPool_name(ctx, field) + case "protocol": + return ec.fieldContext_LoadBalancerPool_protocol(ctx, field) + case "ownerID": + return ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) + case "ports": + return ec.fieldContext_LoadBalancerPool_ports(ctx, field) + case "origins": + return ec.fieldContext_LoadBalancerPool_origins(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancerPool_owner(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerUpdatePayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPool", field.Name) }, } defer func() { @@ -10260,15 +9590,15 @@ func (ec *executionContext) fieldContext_Mutation_loadBalancerUpdate(ctx context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerUpdate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_loadBalancerPool_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerDelete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerDelete(ctx, field) +func (ec *executionContext) _Query_loadBalancerProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_loadBalancerProvider(ctx, field) if err != nil { return graphql.Null } @@ -10281,7 +9611,7 @@ func (ec *executionContext) _Mutation_loadBalancerDelete(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerDelete(rctx, fc.Args["id"].(gidx.PrefixedID)) + return ec.resolvers.Query().LoadBalancerProvider(rctx, fc.Args["id"].(gidx.PrefixedID)) }) if err != nil { ec.Error(ctx, err) @@ -10293,23 +9623,33 @@ func (ec *executionContext) _Mutation_loadBalancerDelete(ctx context.Context, fi } return graphql.Null } - res := resTmp.(*LoadBalancerDeletePayload) + res := resTmp.(*generated.Provider) fc.Result = res - return ec.marshalNLoadBalancerDeletePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerDeletePayload(ctx, field.Selections, res) + return ec.marshalNLoadBalancerProvider2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐProvider(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerDelete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_loadBalancerProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "deletedID": - return ec.fieldContext_LoadBalancerDeletePayload_deletedID(ctx, field) + case "id": + return ec.fieldContext_LoadBalancerProvider_id(ctx, field) + case "createdAt": + return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) + case "name": + return ec.fieldContext_LoadBalancerProvider_name(ctx, field) + case "loadBalancers": + return ec.fieldContext_LoadBalancerProvider_loadBalancers(ctx, field) + case "owner": + return ec.fieldContext_LoadBalancerProvider_owner(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerDeletePayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProvider", field.Name) }, } defer func() { @@ -10319,15 +9659,15 @@ func (ec *executionContext) fieldContext_Mutation_loadBalancerDelete(ctx context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerDelete_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_loadBalancerProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerOriginCreate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerOriginCreate(ctx, field) +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) if err != nil { return graphql.Null } @@ -10340,7 +9680,7 @@ func (ec *executionContext) _Mutation_loadBalancerOriginCreate(ctx context.Conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerOriginCreate(rctx, fc.Args["input"].(generated.CreateLoadBalancerOriginInput)) + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]interface{})), nil }) if err != nil { ec.Error(ctx, err) @@ -10352,23 +9692,19 @@ func (ec *executionContext) _Mutation_loadBalancerOriginCreate(ctx context.Conte } return graphql.Null } - res := resTmp.(*LoadBalancerOriginCreatePayload) + res := resTmp.([]fedruntime.Entity) fc.Result = res - return ec.marshalNLoadBalancerOriginCreatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerOriginCreatePayload(ctx, field.Selections, res) + return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerOriginCreate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Query", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "loadBalancerOrigin": - return ec.fieldContext_LoadBalancerOriginCreatePayload_loadBalancerOrigin(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOriginCreatePayload", field.Name) + return nil, errors.New("field of type _Entity does not have child fields") }, } defer func() { @@ -10378,15 +9714,15 @@ func (ec *executionContext) fieldContext_Mutation_loadBalancerOriginCreate(ctx c } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerOriginCreate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerOriginUpdate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerOriginUpdate(ctx, field) +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) if err != nil { return graphql.Null } @@ -10399,7 +9735,7 @@ func (ec *executionContext) _Mutation_loadBalancerOriginUpdate(ctx context.Conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerOriginUpdate(rctx, fc.Args["id"].(gidx.PrefixedID), fc.Args["input"].(generated.UpdateLoadBalancerOriginInput)) + return ec.__resolve__service(ctx) }) if err != nil { ec.Error(ctx, err) @@ -10411,41 +9747,30 @@ func (ec *executionContext) _Mutation_loadBalancerOriginUpdate(ctx context.Conte } return graphql.Null } - res := resTmp.(*LoadBalancerOriginUpdatePayload) + res := resTmp.(fedruntime.Service) fc.Result = res - return ec.marshalNLoadBalancerOriginUpdatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerOriginUpdatePayload(ctx, field.Selections, res) + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerOriginUpdate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query__service(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Query", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "loadBalancerOrigin": - return ec.fieldContext_LoadBalancerOriginUpdatePayload_loadBalancerOrigin(ctx, field) + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOriginUpdatePayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerOriginUpdate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerOriginDelete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerOriginDelete(ctx, field) +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) if err != nil { return graphql.Null } @@ -10458,35 +9783,50 @@ func (ec *executionContext) _Mutation_loadBalancerOriginDelete(ctx context.Conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerOriginDelete(rctx, fc.Args["id"].(gidx.PrefixedID)) + return ec.introspectType(fc.Args["name"].(string)) }) 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.(*LoadBalancerOriginDeletePayload) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalNLoadBalancerOriginDeletePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerOriginDeletePayload(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerOriginDelete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Query", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "deletedID": - return ec.fieldContext_LoadBalancerOriginDeletePayload_deletedID(ctx, field) + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerOriginDeletePayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } defer func() { @@ -10496,15 +9836,15 @@ func (ec *executionContext) fieldContext_Mutation_loadBalancerOriginDelete(ctx c } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerOriginDelete_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerPoolCreate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerPoolCreate(ctx, field) +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) if err != nil { return graphql.Null } @@ -10517,53 +9857,49 @@ func (ec *executionContext) _Mutation_loadBalancerPoolCreate(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerPoolCreate(rctx, fc.Args["input"].(generated.CreateLoadBalancerPoolInput)) + return ec.introspectSchema() }) 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.(*LoadBalancerPoolCreatePayload) + res := resTmp.(*introspection.Schema) fc.Result = res - return ec.marshalNLoadBalancerPoolCreatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPoolCreatePayload(ctx, field.Selections, res) + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerPoolCreate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Query", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "loadBalancerPool": - return ec.fieldContext_LoadBalancerPoolCreatePayload_loadBalancerPool(ctx, field) + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolCreatePayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerPoolCreate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerPoolUpdate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerPoolUpdate(ctx, field) +func (ec *executionContext) _ResourceOwner_id(ctx context.Context, field graphql.CollectedField, obj *ResourceOwner) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ResourceOwner_id(ctx, field) if err != nil { return graphql.Null } @@ -10576,7 +9912,7 @@ func (ec *executionContext) _Mutation_loadBalancerPoolUpdate(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerPoolUpdate(rctx, fc.Args["id"].(gidx.PrefixedID), fc.Args["input"].(generated.UpdateLoadBalancerPoolInput)) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -10588,41 +9924,26 @@ func (ec *executionContext) _Mutation_loadBalancerPoolUpdate(ctx context.Context } return graphql.Null } - res := resTmp.(*LoadBalancerPoolUpdatePayload) + res := resTmp.(gidx.PrefixedID) fc.Result = res - return ec.marshalNLoadBalancerPoolUpdatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPoolUpdatePayload(ctx, field.Selections, res) + return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerPoolUpdate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ResourceOwner_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "ResourceOwner", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "loadBalancerPool": - return ec.fieldContext_LoadBalancerPoolUpdatePayload_loadBalancerPool(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolUpdatePayload", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerPoolUpdate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerPoolDelete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerPoolDelete(ctx, field) +func (ec *executionContext) _ResourceOwner_loadBalancers(ctx context.Context, field graphql.CollectedField, obj *ResourceOwner) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ResourceOwner_loadBalancers(ctx, field) if err != nil { return graphql.Null } @@ -10635,7 +9956,7 @@ func (ec *executionContext) _Mutation_loadBalancerPoolDelete(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerPoolDelete(rctx, fc.Args["id"].(gidx.PrefixedID)) + return ec.resolvers.ResourceOwner().LoadBalancers(rctx, obj, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerOrder), fc.Args["where"].(*generated.LoadBalancerWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10647,23 +9968,27 @@ func (ec *executionContext) _Mutation_loadBalancerPoolDelete(ctx context.Context } return graphql.Null } - res := resTmp.(*LoadBalancerPoolDeletePayload) + res := resTmp.(*generated.LoadBalancerConnection) fc.Result = res - return ec.marshalNLoadBalancerPoolDeletePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPoolDeletePayload(ctx, field.Selections, res) + return ec.marshalNLoadBalancerConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerPoolDelete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ResourceOwner_loadBalancers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "ResourceOwner", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "deletedID": - return ec.fieldContext_LoadBalancerPoolDeletePayload_deletedID(ctx, field) + case "edges": + return ec.fieldContext_LoadBalancerConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_LoadBalancerConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_LoadBalancerConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolDeletePayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerConnection", field.Name) }, } defer func() { @@ -10673,15 +9998,15 @@ func (ec *executionContext) fieldContext_Mutation_loadBalancerPoolDelete(ctx con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerPoolDelete_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_ResourceOwner_loadBalancers_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerPortCreate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerPortCreate(ctx, field) +func (ec *executionContext) _ResourceOwner_loadBalancerPools(ctx context.Context, field graphql.CollectedField, obj *ResourceOwner) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ResourceOwner_loadBalancerPools(ctx, field) if err != nil { return graphql.Null } @@ -10694,7 +10019,7 @@ func (ec *executionContext) _Mutation_loadBalancerPortCreate(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerPortCreate(rctx, fc.Args["input"].(generated.CreateLoadBalancerPortInput)) + return ec.resolvers.ResourceOwner().LoadBalancerPools(rctx, obj, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerPoolOrder), fc.Args["where"].(*generated.LoadBalancerPoolWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10706,23 +10031,27 @@ func (ec *executionContext) _Mutation_loadBalancerPortCreate(ctx context.Context } return graphql.Null } - res := resTmp.(*LoadBalancerPortCreatePayload) + res := resTmp.(*generated.LoadBalancerPoolConnection) fc.Result = res - return ec.marshalNLoadBalancerPortCreatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPortCreatePayload(ctx, field.Selections, res) + return ec.marshalNLoadBalancerPoolConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerPortCreate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ResourceOwner_loadBalancerPools(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "ResourceOwner", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "loadBalancerPort": - return ec.fieldContext_LoadBalancerPortCreatePayload_loadBalancerPort(ctx, field) + case "edges": + return ec.fieldContext_LoadBalancerPoolConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_LoadBalancerPoolConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_LoadBalancerPoolConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPortCreatePayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolConnection", field.Name) }, } defer func() { @@ -10732,15 +10061,15 @@ func (ec *executionContext) fieldContext_Mutation_loadBalancerPortCreate(ctx con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerPortCreate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_ResourceOwner_loadBalancerPools_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerPortUpdate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerPortUpdate(ctx, field) +func (ec *executionContext) _ResourceOwner_loadBalancersProviders(ctx context.Context, field graphql.CollectedField, obj *ResourceOwner) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ResourceOwner_loadBalancersProviders(ctx, field) if err != nil { return graphql.Null } @@ -10753,7 +10082,7 @@ func (ec *executionContext) _Mutation_loadBalancerPortUpdate(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerPortUpdate(rctx, fc.Args["id"].(gidx.PrefixedID), fc.Args["input"].(generated.UpdateLoadBalancerPortInput)) + return ec.resolvers.ResourceOwner().LoadBalancersProviders(rctx, obj, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerOrder), fc.Args["where"].(*generated.LoadBalancerProviderWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10765,23 +10094,27 @@ func (ec *executionContext) _Mutation_loadBalancerPortUpdate(ctx context.Context } return graphql.Null } - res := resTmp.(*LoadBalancerPortUpdatePayload) + res := resTmp.(*generated.LoadBalancerProviderConnection) fc.Result = res - return ec.marshalNLoadBalancerPortUpdatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPortUpdatePayload(ctx, field.Selections, res) + return ec.marshalNLoadBalancerProviderConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerPortUpdate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ResourceOwner_loadBalancersProviders(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "ResourceOwner", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "loadBalancerPort": - return ec.fieldContext_LoadBalancerPortUpdatePayload_loadBalancerPort(ctx, field) + case "edges": + return ec.fieldContext_LoadBalancerProviderConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_LoadBalancerProviderConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_LoadBalancerProviderConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPortUpdatePayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProviderConnection", field.Name) }, } defer func() { @@ -10791,15 +10124,15 @@ func (ec *executionContext) fieldContext_Mutation_loadBalancerPortUpdate(ctx con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerPortUpdate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_ResourceOwner_loadBalancersProviders_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return + return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerPortDelete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerPortDelete(ctx, field) +func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) if err != nil { return graphql.Null } @@ -10812,53 +10145,35 @@ func (ec *executionContext) _Mutation_loadBalancerPortDelete(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerPortDelete(rctx, fc.Args["id"].(gidx.PrefixedID)) + return obj.SDL, 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.(*LoadBalancerPortDeletePayload) + res := resTmp.(string) fc.Result = res - return ec.marshalNLoadBalancerPortDeletePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerPortDeletePayload(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerPortDelete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "_Service", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "deletedID": - return ec.fieldContext_LoadBalancerPortDeletePayload_deletedID(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPortDeletePayload", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerPortDelete_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerProviderCreate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerProviderCreate(ctx, field) +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) if err != nil { return graphql.Null } @@ -10871,7 +10186,7 @@ func (ec *executionContext) _Mutation_loadBalancerProviderCreate(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerProviderCreate(rctx, fc.Args["input"].(generated.CreateLoadBalancerProviderInput)) + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -10883,41 +10198,26 @@ func (ec *executionContext) _Mutation_loadBalancerProviderCreate(ctx context.Con } return graphql.Null } - res := resTmp.(*LoadBalancerProviderCreatePayload) + res := resTmp.(string) fc.Result = res - return ec.marshalNLoadBalancerProviderCreatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerProviderCreatePayload(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerProviderCreate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "__Directive", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "loadBalancerProvider": - return ec.fieldContext_LoadBalancerProviderCreatePayload_loadBalancerProvider(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProviderCreatePayload", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerProviderCreate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerProviderUpdate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerProviderUpdate(ctx, field) +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) if err != nil { return graphql.Null } @@ -10930,53 +10230,35 @@ func (ec *executionContext) _Mutation_loadBalancerProviderUpdate(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerProviderUpdate(rctx, fc.Args["id"].(gidx.PrefixedID), fc.Args["input"].(generated.UpdateLoadBalancerProviderInput)) + return obj.Description(), 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.(*LoadBalancerProviderUpdatePayload) + res := resTmp.(*string) fc.Result = res - return ec.marshalNLoadBalancerProviderUpdatePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerProviderUpdatePayload(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerProviderUpdate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "__Directive", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "loadBalancerProvider": - return ec.fieldContext_LoadBalancerProviderUpdatePayload_loadBalancerProvider(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProviderUpdatePayload", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerProviderUpdate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_loadBalancerProviderDelete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_loadBalancerProviderDelete(ctx, field) +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) if err != nil { return graphql.Null } @@ -10989,7 +10271,7 @@ func (ec *executionContext) _Mutation_loadBalancerProviderDelete(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().LoadBalancerProviderDelete(rctx, fc.Args["id"].(gidx.PrefixedID)) + return obj.Locations, nil }) if err != nil { ec.Error(ctx, err) @@ -11001,41 +10283,26 @@ func (ec *executionContext) _Mutation_loadBalancerProviderDelete(ctx context.Con } return graphql.Null } - res := resTmp.(*LoadBalancerProviderDeletePayload) + res := resTmp.([]string) fc.Result = res - return ec.marshalNLoadBalancerProviderDeletePayload2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerProviderDeletePayload(ctx, field.Selections, res) + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_loadBalancerProviderDelete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "__Directive", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "deletedID": - return ec.fieldContext_LoadBalancerProviderDeletePayload_deletedID(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProviderDeletePayload", field.Name) + return nil, errors.New("field of type __DirectiveLocation does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_loadBalancerProviderDelete_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Owner_id(ctx context.Context, field graphql.CollectedField, obj *Owner) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Owner_id(ctx, field) +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) if err != nil { return graphql.Null } @@ -11048,7 +10315,7 @@ func (ec *executionContext) _Owner_id(ctx context.Context, field graphql.Collect }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Args, nil }) if err != nil { ec.Error(ctx, err) @@ -11060,26 +10327,36 @@ func (ec *executionContext) _Owner_id(ctx context.Context, field graphql.Collect } return graphql.Null } - res := resTmp.(gidx.PrefixedID) + res := resTmp.([]introspection.InputValue) fc.Result = res - return ec.marshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, field.Selections, res) + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Owner_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Owner", + Object: "__Directive", 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") + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) }, } return fc, nil } -func (ec *executionContext) _Owner_loadBalancers(ctx context.Context, field graphql.CollectedField, obj *Owner) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Owner_loadBalancers(ctx, field) +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) if err != nil { return graphql.Null } @@ -11092,7 +10369,7 @@ func (ec *executionContext) _Owner_loadBalancers(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Owner().LoadBalancers(rctx, obj, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerOrder), fc.Args["where"].(*generated.LoadBalancerWhereInput)) + return obj.IsRepeatable, nil }) if err != nil { ec.Error(ctx, err) @@ -11104,45 +10381,26 @@ func (ec *executionContext) _Owner_loadBalancers(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(*generated.LoadBalancerConnection) + res := resTmp.(bool) fc.Result = res - return ec.marshalNLoadBalancerConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerConnection(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Owner_loadBalancers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Owner", + Object: "__Directive", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_LoadBalancerConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_LoadBalancerConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_LoadBalancerConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerConnection", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Owner_loadBalancers_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Owner_loadBalancerPools(ctx context.Context, field graphql.CollectedField, obj *Owner) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Owner_loadBalancerPools(ctx, field) +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) if err != nil { return graphql.Null } @@ -11155,7 +10413,7 @@ func (ec *executionContext) _Owner_loadBalancerPools(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 ec.resolvers.Owner().LoadBalancerPools(rctx, obj, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerPoolOrder), fc.Args["where"].(*generated.LoadBalancerPoolWhereInput)) + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -11167,45 +10425,26 @@ func (ec *executionContext) _Owner_loadBalancerPools(ctx context.Context, field } return graphql.Null } - res := resTmp.(*generated.LoadBalancerPoolConnection) + res := resTmp.(string) fc.Result = res - return ec.marshalNLoadBalancerPoolConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolConnection(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Owner_loadBalancerPools(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Owner", + Object: "__EnumValue", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_LoadBalancerPoolConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_LoadBalancerPoolConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_LoadBalancerPoolConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolConnection", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Owner_loadBalancerPools_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Owner_loadBalancersProviders(ctx context.Context, field graphql.CollectedField, obj *Owner) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Owner_loadBalancersProviders(ctx, field) +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) if err != nil { return graphql.Null } @@ -11218,57 +10457,35 @@ func (ec *executionContext) _Owner_loadBalancersProviders(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Owner().LoadBalancersProviders(rctx, obj, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerOrder), fc.Args["where"].(*generated.LoadBalancerProviderWhereInput)) + return obj.Description(), 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.LoadBalancerProviderConnection) + res := resTmp.(*string) fc.Result = res - return ec.marshalNLoadBalancerProviderConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderConnection(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Owner_loadBalancersProviders(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Owner", + Object: "__EnumValue", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_LoadBalancerProviderConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_LoadBalancerProviderConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_LoadBalancerProviderConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProviderConnection", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Owner_loadBalancersProviders_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[gidx.PrefixedID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -11281,7 +10498,7 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.HasNextPage, nil + return obj.IsDeprecated(), nil }) if err != nil { ec.Error(ctx, err) @@ -11298,11 +10515,11 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "__EnumValue", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type Boolean does not have child fields") @@ -11311,8 +10528,8 @@ func (ec *executionContext) fieldContext_PageInfo_hasNextPage(ctx context.Contex return fc, nil } -func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[gidx.PrefixedID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -11325,38 +10542,35 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(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.HasPreviousPage, nil + return obj.DeprecationReason(), 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.(bool) + res := resTmp.(*string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "__EnumValue", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[gidx.PrefixedID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) if err != nil { return graphql.Null } @@ -11369,35 +10583,38 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.StartCursor, nil + return obj.Name, 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.(*entgql.Cursor[gidx.PrefixedID]) + res := resTmp.(string) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_startCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "__Field", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Cursor does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[gidx.PrefixedID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) if err != nil { return graphql.Null } @@ -11410,7 +10627,7 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EndCursor, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -11419,26 +10636,26 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(*entgql.Cursor[gidx.PrefixedID]) + res := resTmp.(*string) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_endCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "__Field", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Cursor does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_loadBalancerPools(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_loadBalancerPools(ctx, field) +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) if err != nil { return graphql.Null } @@ -11451,7 +10668,7 @@ func (ec *executionContext) _Query_loadBalancerPools(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 ec.resolvers.Query().LoadBalancerPools(rctx, fc.Args["after"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[gidx.PrefixedID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.LoadBalancerPoolOrder), fc.Args["where"].(*generated.LoadBalancerPoolWhereInput)) + return obj.Args, nil }) if err != nil { ec.Error(ctx, err) @@ -11463,45 +10680,36 @@ func (ec *executionContext) _Query_loadBalancerPools(ctx context.Context, field } return graphql.Null } - res := resTmp.(*generated.LoadBalancerPoolConnection) + res := resTmp.([]introspection.InputValue) fc.Result = res - return ec.marshalNLoadBalancerPoolConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolConnection(ctx, field.Selections, res) + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_loadBalancerPools(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "__Field", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_LoadBalancerPoolConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_LoadBalancerPoolConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_LoadBalancerPoolConnection_totalCount(ctx, field) + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPoolConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_loadBalancerPools_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_loadBalancer(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_loadBalancer(ctx, field) +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) if err != nil { return graphql.Null } @@ -11514,7 +10722,7 @@ func (ec *executionContext) _Query_loadBalancer(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().LoadBalancer(rctx, fc.Args["id"].(gidx.PrefixedID)) + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) @@ -11526,59 +10734,48 @@ func (ec *executionContext) _Query_loadBalancer(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(*generated.LoadBalancer) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalNLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancer(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_loadBalancer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "__Field", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_LoadBalancer_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancer_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancer_updatedAt(ctx, field) + case "kind": + return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext_LoadBalancer_name(ctx, field) - case "annotations": - return ec.fieldContext_LoadBalancer_annotations(ctx, field) - case "statuses": - return ec.fieldContext_LoadBalancer_statuses(ctx, field) - case "ports": - return ec.fieldContext_LoadBalancer_ports(ctx, field) - case "loadBalancerProvider": - return ec.fieldContext_LoadBalancer_loadBalancerProvider(ctx, field) - case "location": - return ec.fieldContext_LoadBalancer_location(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancer_owner(ctx, field) + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancer", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_loadBalancer_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_loadBalancerPool(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_loadBalancerPool(ctx, field) +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -11591,7 +10788,7 @@ func (ec *executionContext) _Query_loadBalancerPool(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 ec.resolvers.Query().LoadBalancerPool(rctx, fc.Args["id"].(gidx.PrefixedID)) + return obj.IsDeprecated(), nil }) if err != nil { ec.Error(ctx, err) @@ -11603,57 +10800,26 @@ func (ec *executionContext) _Query_loadBalancerPool(ctx context.Context, field g } return graphql.Null } - res := resTmp.(*generated.Pool) + res := resTmp.(bool) fc.Result = res - return ec.marshalNLoadBalancerPool2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐPool(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_loadBalancerPool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "__Field", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerPool_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerPool_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerPool_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancerPool_name(ctx, field) - case "protocol": - return ec.fieldContext_LoadBalancerPool_protocol(ctx, field) - case "ownerID": - return ec.fieldContext_LoadBalancerPool_ownerID(ctx, field) - case "ports": - return ec.fieldContext_LoadBalancerPool_ports(ctx, field) - case "origins": - return ec.fieldContext_LoadBalancerPool_origins(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancerPool_owner(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerPool", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_loadBalancerPool_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_loadBalancerProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_loadBalancerProvider(ctx, field) +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -11666,63 +10832,35 @@ func (ec *executionContext) _Query_loadBalancerProvider(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().LoadBalancerProvider(rctx, fc.Args["id"].(gidx.PrefixedID)) + return obj.DeprecationReason(), 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.Provider) + res := resTmp.(*string) fc.Result = res - return ec.marshalNLoadBalancerProvider2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐProvider(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_loadBalancerProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "__Field", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_LoadBalancerProvider_id(ctx, field) - case "createdAt": - return ec.fieldContext_LoadBalancerProvider_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_LoadBalancerProvider_updatedAt(ctx, field) - case "name": - return ec.fieldContext_LoadBalancerProvider_name(ctx, field) - case "loadBalancers": - return ec.fieldContext_LoadBalancerProvider_loadBalancers(ctx, field) - case "owner": - return ec.fieldContext_LoadBalancerProvider_owner(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type LoadBalancerProvider", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_loadBalancerProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query__entities(ctx, field) +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) if err != nil { return graphql.Null } @@ -11735,7 +10873,7 @@ func (ec *executionContext) _Query__entities(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]interface{})), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -11747,37 +10885,26 @@ func (ec *executionContext) _Query__entities(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.([]fedruntime.Entity) + res := resTmp.(string) fc.Result = res - return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type _Entity does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query__service(ctx, field) +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) if err != nil { return graphql.Null } @@ -11790,42 +10917,35 @@ func (ec *executionContext) _Query__service(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.__resolve__service(ctx) + return obj.Description(), 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.(fedruntime.Service) + res := resTmp.(*string) fc.Result = res - return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query__service(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "__InputValue", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "sdl": - return ec.fieldContext__Service_sdl(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___type(ctx, field) +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) if err != nil { return graphql.Null } @@ -11838,25 +10958,28 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) + return obj.Type, 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.(*introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -11884,22 +11007,11 @@ func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) if err != nil { return graphql.Null } @@ -11912,7 +11024,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() + return obj.DefaultValue, nil }) if err != nil { ec.Error(ctx, err) @@ -11921,40 +11033,26 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "description": - return ec.fieldContext___Schema_description(ctx, field) - case "types": - return ec.fieldContext___Schema_types(ctx, field) - case "queryType": - return ec.fieldContext___Schema_queryType(ctx, field) - case "mutationType": - return ec.fieldContext___Schema_mutationType(ctx, field) - case "subscriptionType": - return ec.fieldContext___Schema_subscriptionType(ctx, field) - case "directives": - return ec.fieldContext___Schema_directives(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { - fc, err := ec.fieldContext__Service_sdl(ctx, field) +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) if err != nil { return graphql.Null } @@ -11967,7 +11065,7 @@ func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SDL, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -11976,16 +11074,16 @@ func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.Col if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "_Service", + Object: "__Schema", Field: field, - IsMethod: false, + IsMethod: true, 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") @@ -11994,8 +11092,8 @@ func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field return fc, nil } -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) if err != nil { return graphql.Null } @@ -12008,7 +11106,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql }() 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.Types(), nil }) if err != nil { ec.Error(ctx, err) @@ -12020,26 +11118,48 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "__Schema", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) if err != nil { return graphql.Null } @@ -12052,35 +11172,60 @@ func (ec *executionContext) ___Directive_description(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.Description(), nil + return obj.QueryType(), 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) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "__Schema", Field: field, IsMethod: true, 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") + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) if err != nil { return graphql.Null } @@ -12093,38 +11238,57 @@ func (ec *executionContext) ___Directive_locations(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.Locations, nil + return obj.MutationType(), 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) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "__Schema", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_args(ctx, field) +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) if err != nil { return graphql.Null } @@ -12137,48 +11301,57 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.SubscriptionType(), 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.([]introspection.InputValue) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "__Schema", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___InputValue_name(ctx, field) + return ec.fieldContext___Type_name(ctx, field) case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) if err != nil { return graphql.Null } @@ -12191,7 +11364,7 @@ func (ec *executionContext) ___Directive_isRepeatable(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.IsRepeatable, nil + return obj.Directives(), nil }) if err != nil { ec.Error(ctx, err) @@ -12203,26 +11376,38 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]introspection.Directive) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "__Schema", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) }, } return fc, nil } -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) if err != nil { return graphql.Null } @@ -12235,7 +11420,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql }() 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.Kind(), nil }) if err != nil { ec.Error(ctx, err) @@ -12249,24 +11434,24 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } res := resTmp.(string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Type", Field: field, - IsMethod: false, + IsMethod: true, 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 nil, errors.New("field of type __TypeKind does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) if err != nil { return graphql.Null } @@ -12279,7 +11464,7 @@ func (ec *executionContext) ___EnumValue_description(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.Description(), nil + return obj.Name(), nil }) if err != nil { ec.Error(ctx, err) @@ -12293,9 +11478,9 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Type", Field: field, IsMethod: true, IsResolver: false, @@ -12306,8 +11491,8 @@ func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Con return fc, nil } -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) if err != nil { return graphql.Null } @@ -12320,38 +11505,35 @@ func (ec *executionContext) ___EnumValue_isDeprecated(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.IsDeprecated(), nil + return obj.Description(), 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.(bool) + res := resTmp.(*string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Type", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) if err != nil { return graphql.Null } @@ -12364,7 +11546,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil }) if err != nil { ec.Error(ctx, err) @@ -12373,26 +11555,51 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]introspection.Field) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Type", Field: field, IsMethod: true, 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") + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) if err != nil { return graphql.Null } @@ -12405,38 +11612,57 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col }() 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.Interfaces(), 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) + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Type", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) if err != nil { return graphql.Null } @@ -12449,7 +11675,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.PossibleTypes(), nil }) if err != nil { ec.Error(ctx, err) @@ -12458,26 +11684,48 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Type", Field: field, IsMethod: true, 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") + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) if err != nil { return graphql.Null } @@ -12490,243 +11738,56 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), 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.([]introspection.InputValue) + res := resTmp.([]introspection.EnumValue) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Type", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "name": - return ec.fieldContext___InputValue_name(ctx, field) + return ec.fieldContext___EnumValue_name(ctx, field) case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) }, } - return fc, nil -} - -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_type(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.Type, 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.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_isDeprecated(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.IsDeprecated(), 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.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_deprecationReason(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 + err = ec.Recover(ctx, r) + ec.Error(ctx, err) } }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), 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.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - 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) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_name(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.Name, nil - }) - if err != nil { + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); 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) -} - -func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - 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, err } return fc, nil } -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_description(ctx, field) +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) if err != nil { return graphql.Null } @@ -12739,7 +11800,7 @@ func (ec *executionContext) ___InputValue_description(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.Description(), nil + return obj.InputFields(), nil }) if err != nil { ec.Error(ctx, err) @@ -12748,26 +11809,36 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]introspection.InputValue) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Type", Field: field, IsMethod: true, 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") + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) }, } return fc, nil } -func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_type(ctx, field) +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) if err != nil { return graphql.Null } @@ -12780,28 +11851,25 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.OfType(), 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.(*introspection.Type) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Type", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -12832,8 +11900,8 @@ func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, return fc, nil } -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) if err != nil { return graphql.Null } @@ -12846,7 +11914,7 @@ func (ec *executionContext) ___InputValue_defaultValue(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.DefaultValue, nil + return obj.SpecifiedByURL(), nil }) if err != nil { ec.Error(ctx, err) @@ -12860,11 +11928,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Type", Field: field, - IsMethod: false, + IsMethod: true, 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") @@ -12873,2203 +11941,343 @@ func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.C return fc, nil } -func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_description(ctx, field) - if err != nil { - return graphql.Null +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputCreateLoadBalancerInput(ctx context.Context, obj interface{}) (generated.CreateLoadBalancerInput, error) { + var it generated.CreateLoadBalancerInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - 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.Description(), 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.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - 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) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_types(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.Types(), 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.([]introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_queryType(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.QueryType(), 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.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_mutationType(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.MutationType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_subscriptionType(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.SubscriptionType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_directives(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.Directives(), 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.([]introspection.Directive) - fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_kind(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.Kind(), 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.marshalN__TypeKind2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_name(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.Name(), 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.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - 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) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(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.Description(), 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.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - 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) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_fields(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.Fields(fc.Args["includeDeprecated"].(bool)), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Field) - fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Field_name(ctx, field) - case "description": - return ec.fieldContext___Field_description(ctx, field) - case "args": - return ec.fieldContext___Field_args(ctx, field) - case "type": - return ec.fieldContext___Field_type(ctx, field) - case "isDeprecated": - return ec.fieldContext___Field_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___Field_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_interfaces(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.Interfaces(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_possibleTypes(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.PossibleTypes(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_enumValues(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.EnumValues(fc.Args["includeDeprecated"].(bool)), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.EnumValue) - fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___EnumValue_name(ctx, field) - case "description": - return ec.fieldContext___EnumValue_description(ctx, field) - case "isDeprecated": - return ec.fieldContext___EnumValue_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___EnumValue_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(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.InputFields(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_ofType(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.OfType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_specifiedByURL(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.SpecifiedByURL(), 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.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - 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 -} - -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -func (ec *executionContext) unmarshalInputCreateLoadBalancerInput(ctx context.Context, obj interface{}) (generated.CreateLoadBalancerInput, error) { - var it generated.CreateLoadBalancerInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"name", "ownerID", "locationID", "portIDs", "providerID"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Name = data - case "ownerID": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) - data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.OwnerID = data - case "locationID": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("locationID")) - data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.LocationID = data - case "portIDs": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portIDs")) - data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) - if err != nil { - return it, err - } - it.PortIDs = data - case "providerID": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("providerID")) - data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.ProviderID = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateLoadBalancerOriginInput(ctx context.Context, obj interface{}) (generated.CreateLoadBalancerOriginInput, error) { - var it generated.CreateLoadBalancerOriginInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"name", "target", "portNumber", "active", "poolID"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Name = data - case "target": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("target")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Target = data - case "portNumber": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumber")) - data, err := ec.unmarshalNInt2int(ctx, v) - if err != nil { - return it, err - } - it.PortNumber = data - case "active": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("active")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err - } - it.Active = data - case "poolID": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("poolID")) - data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.PoolID = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateLoadBalancerPoolInput(ctx context.Context, obj interface{}) (generated.CreateLoadBalancerPoolInput, error) { - var it generated.CreateLoadBalancerPoolInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"name", "protocol", "ownerID", "portIDs", "originIDs"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Name = data - case "protocol": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("protocol")) - data, err := ec.unmarshalNLoadBalancerPoolProtocol2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocol(ctx, v) - if err != nil { - return it, err - } - it.Protocol = data - case "ownerID": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) - data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.OwnerID = data - case "portIDs": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portIDs")) - data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) - if err != nil { - return it, err - } - it.PortIDs = data - case "originIDs": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("originIDs")) - data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) - if err != nil { - return it, err - } - it.OriginIDs = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateLoadBalancerPortInput(ctx context.Context, obj interface{}) (generated.CreateLoadBalancerPortInput, error) { - var it generated.CreateLoadBalancerPortInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"number", "name", "poolIDs", "loadBalancerID"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "number": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("number")) - data, err := ec.unmarshalNInt2int(ctx, v) - if err != nil { - return it, err - } - it.Number = data - case "name": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Name = data - case "poolIDs": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("poolIDs")) - data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) - if err != nil { - return it, err - } - it.PoolIDs = data - case "loadBalancerID": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("loadBalancerID")) - data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.LoadBalancerID = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateLoadBalancerProviderInput(ctx context.Context, obj interface{}) (generated.CreateLoadBalancerProviderInput, error) { - var it generated.CreateLoadBalancerProviderInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"name", "ownerID"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Name = data - case "ownerID": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) - data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.OwnerID = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputLoadBalancerAnnotationOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerAnnotationOrder, error) { - var it generated.LoadBalancerAnnotationOrder - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - if _, present := asMap["direction"]; !present { - asMap["direction"] = "ASC" - } - - fieldsInOrder := [...]string{"direction", "field"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "direction": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) - data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) - if err != nil { - return it, err - } - it.Direction = data - case "field": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNLoadBalancerAnnotationOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationOrderField(ctx, v) - if err != nil { - return it, err - } - it.Field = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputLoadBalancerAnnotationWhereInput(ctx context.Context, obj interface{}) (generated.LoadBalancerAnnotationWhereInput, error) { - var it generated.LoadBalancerAnnotationWhereInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - 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", "hasLoadBalancer", "hasLoadBalancerWith"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "not": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOLoadBalancerAnnotationWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationWhereInput(ctx, v) - if err != nil { - return it, err - } - it.Not = data - case "and": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOLoadBalancerAnnotationWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationWhereInputᚄ(ctx, v) - if err != nil { - return it, err - } - it.And = data - case "or": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOLoadBalancerAnnotationWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationWhereInputᚄ(ctx, v) - if err != nil { - return it, err - } - it.Or = data - case "id": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.ID = data - case "idNEQ": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.IDNEQ = data - case "idIn": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) - data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) - if err != nil { - return it, err - } - it.IDIn = data - case "idNotIn": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) - data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) - if err != nil { - return it, err - } - it.IDNotIn = data - case "idGT": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.IDGT = data - case "idGTE": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.IDGTE = data - case "idLT": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.IDLT = data - case "idLTE": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.IDLTE = data - case "createdAt": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) - if err != nil { - return it, err - } - 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 "hasLoadBalancer": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancer")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err - } - it.HasLoadBalancer = data - case "hasLoadBalancerWith": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancerWith")) - data, err := ec.unmarshalOLoadBalancerWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerWhereInputᚄ(ctx, v) - if err != nil { - return it, err - } - it.HasLoadBalancerWith = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputLoadBalancerOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerOrder, error) { - var it generated.LoadBalancerOrder - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - if _, present := asMap["direction"]; !present { - asMap["direction"] = "ASC" - } - - fieldsInOrder := [...]string{"direction", "field"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "direction": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) - data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) - if err != nil { - return it, err - } - it.Direction = data - case "field": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNLoadBalancerOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOrderField(ctx, v) - if err != nil { - return it, err - } - it.Field = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputLoadBalancerOriginOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerOriginOrder, error) { - var it generated.LoadBalancerOriginOrder - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - if _, present := asMap["direction"]; !present { - asMap["direction"] = "ASC" - } - - fieldsInOrder := [...]string{"direction", "field"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "direction": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) - data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) - if err != nil { - return it, err - } - it.Direction = data - case "field": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNLoadBalancerOriginOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginOrderField(ctx, v) - if err != nil { - return it, err - } - it.Field = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputLoadBalancerOriginWhereInput(ctx context.Context, obj interface{}) (generated.LoadBalancerOriginWhereInput, error) { - var it generated.LoadBalancerOriginWhereInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - 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", "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 { - continue - } - switch k { - case "not": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOLoadBalancerOriginWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginWhereInput(ctx, v) - if err != nil { - return it, err - } - it.Not = data - case "and": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOLoadBalancerOriginWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginWhereInputᚄ(ctx, v) - if err != nil { - return it, err - } - it.And = data - case "or": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOLoadBalancerOriginWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginWhereInputᚄ(ctx, v) - if err != nil { - return it, err - } - it.Or = data - case "id": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.ID = data - case "idNEQ": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.IDNEQ = data - case "idIn": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) - data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) - if err != nil { - return it, err - } - it.IDIn = data - case "idNotIn": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) - data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) - if err != nil { - return it, err - } - it.IDNotIn = data - case "idGT": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.IDGT = data - case "idGTE": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.IDGTE = data - case "idLT": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.IDLT = data - case "idLTE": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) - data, err := ec.unmarshalOID2ᚖgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) - if err != nil { - return it, err - } - it.IDLTE = data - case "createdAt": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) - if err != nil { - return it, err - } - 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 "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": + fieldsInOrder := [...]string{"name", "ownerID", "locationID", "portIDs", "providerID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContains")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - it.NameContains = data - case "nameHasPrefix": + it.Name = data + case "ownerID": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasPrefix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) if err != nil { return it, err } - it.NameHasPrefix = data - case "nameHasSuffix": + it.OwnerID = data + case "locationID": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasSuffix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("locationID")) + data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) if err != nil { return it, err } - it.NameHasSuffix = data - case "nameEqualFold": + it.LocationID = data + case "portIDs": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portIDs")) + data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) if err != nil { return it, err } - it.NameEqualFold = data - case "nameContainsFold": + it.PortIDs = data + case "providerID": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContainsFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("providerID")) + data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) if err != nil { return it, err } - it.NameContainsFold = data - case "target": - var err error + it.ProviderID = data + } + } - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("target")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.Target = data - case "targetNEQ": - var err error + return it, nil +} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNEQ")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.TargetNEQ = data - case "targetIn": - var err error +func (ec *executionContext) unmarshalInputCreateLoadBalancerOriginInput(ctx context.Context, obj interface{}) (generated.CreateLoadBalancerOriginInput, error) { + var it generated.CreateLoadBalancerOriginInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.TargetIn = data - case "targetNotIn": + fieldsInOrder := [...]string{"name", "target", "portNumber", "active", "poolID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNotIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - it.TargetNotIn = data - case "targetGT": + it.Name = data + case "target": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetGT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("target")) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - it.TargetGT = data - case "targetGTE": + it.Target = data + case "portNumber": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetGTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumber")) + data, err := ec.unmarshalNInt2int(ctx, v) if err != nil { return it, err } - it.TargetGTE = data - case "targetLT": + it.PortNumber = data + case "active": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetLT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("active")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.TargetLT = data - case "targetLTE": + it.Active = data + case "poolID": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetLTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("poolID")) + data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) if err != nil { return it, err } - it.TargetLTE = data - case "targetContains": - var err error + it.PoolID = data + } + } - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetContains")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.TargetContains = data - case "targetHasPrefix": - var err error + return it, nil +} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetHasPrefix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.TargetHasPrefix = data - case "targetHasSuffix": - var err error +func (ec *executionContext) unmarshalInputCreateLoadBalancerPoolInput(ctx context.Context, obj interface{}) (generated.CreateLoadBalancerPoolInput, error) { + var it generated.CreateLoadBalancerPoolInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetHasSuffix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.TargetHasSuffix = data - case "targetEqualFold": + fieldsInOrder := [...]string{"name", "protocol", "ownerID", "portIDs", "originIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - it.TargetEqualFold = data - case "targetContainsFold": + it.Name = data + case "protocol": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetContainsFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("protocol")) + data, err := ec.unmarshalNLoadBalancerPoolProtocol2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚋpoolᚐProtocol(ctx, v) if err != nil { return it, err } - it.TargetContainsFold = data - case "portNumber": + it.Protocol = data + case "ownerID": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumber")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) if err != nil { return it, err } - it.PortNumber = data - case "portNumberNEQ": + it.OwnerID = data + case "portIDs": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumberNEQ")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portIDs")) + data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) if err != nil { return it, err } - it.PortNumberNEQ = data - case "portNumberIn": + it.PortIDs = data + case "originIDs": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumberIn")) - data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("originIDs")) + data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) if err != nil { return it, err } - it.PortNumberIn = data - case "portNumberNotIn": - var err error + it.OriginIDs = data + } + } - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumberNotIn")) - data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) - if err != nil { - return it, err - } - it.PortNumberNotIn = data - case "portNumberGT": + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateLoadBalancerPortInput(ctx context.Context, obj interface{}) (generated.CreateLoadBalancerPortInput, error) { + var it generated.CreateLoadBalancerPortInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"number", "name", "poolIDs", "loadBalancerID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "number": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumberGT")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("number")) + data, err := ec.unmarshalNInt2int(ctx, v) if err != nil { return it, err } - it.PortNumberGT = data - case "portNumberGTE": + it.Number = data + case "name": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumberGTE")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - it.PortNumberGTE = data - case "portNumberLT": + it.Name = data + case "poolIDs": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumberLT")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("poolIDs")) + data, err := ec.unmarshalOID2ᚕgoᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedIDᚄ(ctx, v) if err != nil { return it, err - } - it.PortNumberLT = data - case "portNumberLTE": + } + it.PoolIDs = data + case "loadBalancerID": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumberLTE")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("loadBalancerID")) + data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) if err != nil { return it, err } - it.PortNumberLTE = data - case "active": + it.LoadBalancerID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateLoadBalancerProviderInput(ctx context.Context, obj interface{}) (generated.CreateLoadBalancerProviderInput, error) { + var it generated.CreateLoadBalancerProviderInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "ownerID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("active")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - it.Active = data - case "activeNEQ": + it.Name = data + case "ownerID": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activeNEQ")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx, v) if err != nil { return it, err } - it.ActiveNEQ = data - case "hasPool": + it.OwnerID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputLoadBalancerOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerOrder, error) { + var it generated.LoadBalancerOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPool")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) if err != nil { return it, err } - it.HasPool = data - case "hasPoolWith": + it.Direction = data + case "field": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPoolWith")) - data, err := ec.unmarshalOLoadBalancerPoolWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInputᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNLoadBalancerOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOrderField(ctx, v) if err != nil { return it, err } - it.HasPoolWith = data + it.Field = data } } return it, nil } -func (ec *executionContext) unmarshalInputLoadBalancerPoolOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerPoolOrder, error) { - var it generated.LoadBalancerPoolOrder +func (ec *executionContext) unmarshalInputLoadBalancerOriginOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerOriginOrder, error) { + var it generated.LoadBalancerOriginOrder asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v @@ -15099,7 +12307,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerPoolOrder(ctx context.Cont var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNLoadBalancerPoolOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolOrderField(ctx, v) + data, err := ec.unmarshalNLoadBalancerOriginOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginOrderField(ctx, v) if err != nil { return it, err } @@ -15110,14 +12318,14 @@ func (ec *executionContext) unmarshalInputLoadBalancerPoolOrder(ctx context.Cont return it, nil } -func (ec *executionContext) unmarshalInputLoadBalancerPoolWhereInput(ctx context.Context, obj interface{}) (generated.LoadBalancerPoolWhereInput, error) { - var it generated.LoadBalancerPoolWhereInput +func (ec *executionContext) unmarshalInputLoadBalancerOriginWhereInput(ctx context.Context, obj interface{}) (generated.LoadBalancerOriginWhereInput, error) { + var it generated.LoadBalancerOriginWhereInput asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { 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", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "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 { @@ -15128,7 +12336,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerPoolWhereInput(ctx context var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOLoadBalancerPoolWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInput(ctx, v) + data, err := ec.unmarshalOLoadBalancerOriginWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginWhereInput(ctx, v) if err != nil { return it, err } @@ -15137,7 +12345,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerPoolWhereInput(ctx context var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOLoadBalancerPoolWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOLoadBalancerOriginWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -15146,7 +12354,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerPoolWhereInput(ctx context var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOLoadBalancerPoolWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOLoadBalancerOriginWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -15352,218 +12560,371 @@ func (ec *executionContext) unmarshalInputLoadBalancerPoolWhereInput(ctx context case "updatedAtLT": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + 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 "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 "target": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("target")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Target = data + case "targetNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TargetNEQ = data + case "targetIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.UpdatedAtLT = data - case "updatedAtLTE": + it.TargetIn = data + case "targetNotIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.UpdatedAtLTE = data - case "name": + it.TargetNotIn = data + case "targetGT": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Name = data - case "nameNEQ": + it.TargetGT = data + case "targetGTE": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNEQ")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameNEQ = data - case "nameIn": + it.TargetGTE = data + case "targetLT": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameIn = data - case "nameNotIn": + it.TargetLT = data + case "targetLTE": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNotIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameNotIn = data - case "nameGT": + it.TargetLTE = data + case "targetContains": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameGT")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameGT = data - case "nameGTE": + it.TargetContains = data + case "targetHasPrefix": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameGTE")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameGTE = data - case "nameLT": + it.TargetHasPrefix = data + case "targetHasSuffix": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameLT")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameLT = data - case "nameLTE": + it.TargetHasSuffix = data + case "targetEqualFold": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameLTE")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameLTE = data - case "nameContains": + it.TargetEqualFold = data + case "targetContainsFold": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContains")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameContains = data - case "nameHasPrefix": + it.TargetContainsFold = data + case "portNumber": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasPrefix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumber")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) if err != nil { return it, err } - it.NameHasPrefix = data - case "nameHasSuffix": + it.PortNumber = data + case "portNumberNEQ": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasSuffix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumberNEQ")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) if err != nil { return it, err } - it.NameHasSuffix = data - case "nameEqualFold": + it.PortNumberNEQ = data + case "portNumberIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumberIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) if err != nil { return it, err } - it.NameEqualFold = data - case "nameContainsFold": + it.PortNumberIn = data + case "portNumberNotIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContainsFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portNumberNotIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) if err != nil { return it, err } - it.NameContainsFold = data - case "protocol": + it.PortNumberNotIn = data + case "portNumberGT": 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("portNumberGT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) if err != nil { return it, err } - it.Protocol = data - case "protocolNEQ": + it.PortNumberGT = data + case "portNumberGTE": 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("portNumberGTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) if err != nil { return it, err } - it.ProtocolNEQ = data - case "protocolIn": + it.PortNumberGTE = data + case "portNumberLT": 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("portNumberLT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) if err != nil { return it, err } - it.ProtocolIn = data - case "protocolNotIn": + it.PortNumberLT = data + case "portNumberLTE": 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("portNumberLTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) if err != nil { return it, err } - it.ProtocolNotIn = data - case "hasPorts": + it.PortNumberLTE = data + case "active": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPorts")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("active")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.HasPorts = data - case "hasPortsWith": + it.Active = data + case "activeNEQ": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPortsWith")) - data, err := ec.unmarshalOLoadBalancerPortWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortWhereInputᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activeNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.HasPortsWith = data - case "hasOrigins": + it.ActiveNEQ = data + case "hasPool": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrigins")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPool")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.HasOrigins = data - case "hasOriginsWith": + it.HasPool = data + case "hasPoolWith": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOriginsWith")) - data, err := ec.unmarshalOLoadBalancerOriginWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginWhereInputᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPoolWith")) + data, err := ec.unmarshalOLoadBalancerPoolWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.HasOriginsWith = data + it.HasPoolWith = data } } return it, nil } -func (ec *executionContext) unmarshalInputLoadBalancerPortOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerPortOrder, error) { - var it generated.LoadBalancerPortOrder +func (ec *executionContext) unmarshalInputLoadBalancerPoolOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerPoolOrder, error) { + var it generated.LoadBalancerPoolOrder asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v @@ -15593,7 +12954,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerPortOrder(ctx context.Cont var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNLoadBalancerPortOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortOrderField(ctx, v) + data, err := ec.unmarshalNLoadBalancerPoolOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolOrderField(ctx, v) if err != nil { return it, err } @@ -15604,14 +12965,14 @@ func (ec *executionContext) unmarshalInputLoadBalancerPortOrder(ctx context.Cont return it, nil } -func (ec *executionContext) unmarshalInputLoadBalancerPortWhereInput(ctx context.Context, obj interface{}) (generated.LoadBalancerPortWhereInput, error) { - var it generated.LoadBalancerPortWhereInput +func (ec *executionContext) unmarshalInputLoadBalancerPoolWhereInput(ctx context.Context, obj interface{}) (generated.LoadBalancerPoolWhereInput, error) { + var it generated.LoadBalancerPoolWhereInput asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { 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", "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 { @@ -15622,7 +12983,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerPortWhereInput(ctx context var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOLoadBalancerPortWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortWhereInput(ctx, v) + data, err := ec.unmarshalOLoadBalancerPoolWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInput(ctx, v) if err != nil { return it, err } @@ -15631,7 +12992,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerPortWhereInput(ctx context var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOLoadBalancerPortWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOLoadBalancerPoolWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -15640,7 +13001,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerPortWhereInput(ctx context var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOLoadBalancerPortWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOLoadBalancerPoolWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -15801,138 +13162,66 @@ func (ec *executionContext) unmarshalInputLoadBalancerPortWhereInput(ctx context 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 "number": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("number")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - it.Number = data - case "numberNEQ": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberNEQ")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) if err != nil { return it, err } - it.NumberNEQ = data - case "numberIn": + it.UpdatedAtNEQ = data + case "updatedAtIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberIn")) - data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) if err != nil { return it, err } - it.NumberIn = data - case "numberNotIn": + it.UpdatedAtIn = data + case "updatedAtNotIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberNotIn")) - data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) if err != nil { return it, err } - it.NumberNotIn = data - case "numberGT": + it.UpdatedAtNotIn = data + case "updatedAtGT": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberGT")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) if err != nil { return it, err } - it.NumberGT = data - case "numberGTE": + it.UpdatedAtGT = data + case "updatedAtGTE": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberGTE")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) if err != nil { return it, err } - it.NumberGTE = data - case "numberLT": + it.UpdatedAtGTE = data + case "updatedAtLT": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberLT")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) if err != nil { return it, err } - it.NumberLT = data - case "numberLTE": + it.UpdatedAtLT = data + case "updatedAtLTE": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberLTE")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) if err != nil { return it, err } - it.NumberLTE = data + it.UpdatedAtLTE = data case "name": var err error @@ -16050,50 +13339,86 @@ func (ec *executionContext) unmarshalInputLoadBalancerPortWhereInput(ctx context return it, err } it.NameContainsFold = data - case "hasPools": + case "protocol": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPools")) + 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.HasPools = data - case "hasPoolsWith": + it.HasPorts = data + case "hasPortsWith": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPoolsWith")) - data, err := ec.unmarshalOLoadBalancerPoolWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInputᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPortsWith")) + data, err := ec.unmarshalOLoadBalancerPortWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.HasPoolsWith = data - case "hasLoadBalancer": + it.HasPortsWith = data + case "hasOrigins": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancer")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrigins")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.HasLoadBalancer = data - case "hasLoadBalancerWith": + it.HasOrigins = data + case "hasOriginsWith": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancerWith")) - data, err := ec.unmarshalOLoadBalancerWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerWhereInputᚄ(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOriginsWith")) + data, err := ec.unmarshalOLoadBalancerOriginWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerOriginWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.HasLoadBalancerWith = data + it.HasOriginsWith = data } } return it, nil } -func (ec *executionContext) unmarshalInputLoadBalancerProviderOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerProviderOrder, error) { - var it generated.LoadBalancerProviderOrder +func (ec *executionContext) unmarshalInputLoadBalancerPortOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerPortOrder, error) { + var it generated.LoadBalancerPortOrder asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v @@ -16123,7 +13448,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerProviderOrder(ctx context. var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNLoadBalancerProviderOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderOrderField(ctx, v) + data, err := ec.unmarshalNLoadBalancerPortOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortOrderField(ctx, v) if err != nil { return it, err } @@ -16134,14 +13459,14 @@ func (ec *executionContext) unmarshalInputLoadBalancerProviderOrder(ctx context. return it, nil } -func (ec *executionContext) unmarshalInputLoadBalancerProviderWhereInput(ctx context.Context, obj interface{}) (generated.LoadBalancerProviderWhereInput, error) { - var it generated.LoadBalancerProviderWhereInput +func (ec *executionContext) unmarshalInputLoadBalancerPortWhereInput(ctx context.Context, obj interface{}) (generated.LoadBalancerPortWhereInput, error) { + var it generated.LoadBalancerPortWhereInput asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { 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", "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 { @@ -16152,7 +13477,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerProviderWhereInput(ctx con var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOLoadBalancerProviderWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderWhereInput(ctx, v) + data, err := ec.unmarshalOLoadBalancerPortWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortWhereInput(ctx, v) if err != nil { return it, err } @@ -16161,7 +13486,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerProviderWhereInput(ctx con var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOLoadBalancerProviderWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOLoadBalancerPortWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -16170,7 +13495,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerProviderWhereInput(ctx con var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOLoadBalancerProviderWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOLoadBalancerPortWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPortWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -16391,6 +13716,78 @@ func (ec *executionContext) unmarshalInputLoadBalancerProviderWhereInput(ctx con return it, err } it.UpdatedAtLTE = data + case "number": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("number")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Number = data + case "numberNEQ": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberNEQ")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.NumberNEQ = data + case "numberIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.NumberIn = data + case "numberNotIn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberNotIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.NumberNotIn = data + case "numberGT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberGT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.NumberGT = data + case "numberGTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberGTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.NumberGTE = data + case "numberLT": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberLT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.NumberLT = data + case "numberLTE": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numberLTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.NumberLTE = data case "name": var err error @@ -16508,32 +13905,50 @@ func (ec *executionContext) unmarshalInputLoadBalancerProviderWhereInput(ctx con return it, err } it.NameContainsFold = data - case "hasLoadBalancers": + case "hasPools": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancers")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPools")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.HasLoadBalancers = data - case "hasLoadBalancersWith": + it.HasPools = data + case "hasPoolsWith": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancersWith")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPoolsWith")) + data, err := ec.unmarshalOLoadBalancerPoolWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerPoolWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasPoolsWith = data + case "hasLoadBalancer": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancer")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasLoadBalancer = data + case "hasLoadBalancerWith": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancerWith")) data, err := ec.unmarshalOLoadBalancerWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.HasLoadBalancersWith = data + it.HasLoadBalancerWith = data } } return it, nil } -func (ec *executionContext) unmarshalInputLoadBalancerStatusOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerStatusOrder, error) { - var it generated.LoadBalancerStatusOrder +func (ec *executionContext) unmarshalInputLoadBalancerProviderOrder(ctx context.Context, obj interface{}) (generated.LoadBalancerProviderOrder, error) { + var it generated.LoadBalancerProviderOrder asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v @@ -16563,7 +13978,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerStatusOrder(ctx context.Co var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNLoadBalancerStatusOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusOrderField(ctx, v) + data, err := ec.unmarshalNLoadBalancerProviderOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderOrderField(ctx, v) if err != nil { return it, err } @@ -16574,14 +13989,14 @@ func (ec *executionContext) unmarshalInputLoadBalancerStatusOrder(ctx context.Co return it, nil } -func (ec *executionContext) unmarshalInputLoadBalancerStatusWhereInput(ctx context.Context, obj interface{}) (generated.LoadBalancerStatusWhereInput, error) { - var it generated.LoadBalancerStatusWhereInput +func (ec *executionContext) unmarshalInputLoadBalancerProviderWhereInput(ctx context.Context, obj interface{}) (generated.LoadBalancerProviderWhereInput, error) { + var it generated.LoadBalancerProviderWhereInput asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { 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", "source", "sourceNEQ", "sourceIn", "sourceNotIn", "sourceGT", "sourceGTE", "sourceLT", "sourceLTE", "sourceContains", "sourceHasPrefix", "sourceHasSuffix", "sourceEqualFold", "sourceContainsFold", "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", "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 { @@ -16592,7 +14007,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerStatusWhereInput(ctx conte var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOLoadBalancerStatusWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusWhereInput(ctx, v) + data, err := ec.unmarshalOLoadBalancerProviderWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderWhereInput(ctx, v) if err != nil { return it, err } @@ -16601,7 +14016,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerStatusWhereInput(ctx conte var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOLoadBalancerStatusWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOLoadBalancerProviderWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -16610,7 +14025,7 @@ func (ec *executionContext) unmarshalInputLoadBalancerStatusWhereInput(ctx conte var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOLoadBalancerStatusWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOLoadBalancerProviderWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerProviderWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -16831,141 +14246,141 @@ func (ec *executionContext) unmarshalInputLoadBalancerStatusWhereInput(ctx conte return it, err } it.UpdatedAtLTE = data - case "source": + case "name": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("source")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Source = data - case "sourceNEQ": + it.Name = data + case "nameNEQ": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceNEQ")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SourceNEQ = data - case "sourceIn": + it.NameNEQ = data + case "nameIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceIn")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.SourceIn = data - case "sourceNotIn": + it.NameIn = data + case "nameNotIn": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceNotIn")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.SourceNotIn = data - case "sourceGT": + it.NameNotIn = data + case "nameGT": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceGT")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SourceGT = data - case "sourceGTE": + it.NameGT = data + case "nameGTE": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceGTE")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SourceGTE = data - case "sourceLT": + it.NameGTE = data + case "nameLT": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceLT")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SourceLT = data - case "sourceLTE": + it.NameLT = data + case "nameLTE": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceLTE")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SourceLTE = data - case "sourceContains": + it.NameLTE = data + case "nameContains": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceContains")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SourceContains = data - case "sourceHasPrefix": + it.NameContains = data + case "nameHasPrefix": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceHasPrefix")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SourceHasPrefix = data - case "sourceHasSuffix": + it.NameHasPrefix = data + case "nameHasSuffix": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceHasSuffix")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SourceHasSuffix = data - case "sourceEqualFold": + it.NameHasSuffix = data + case "nameEqualFold": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceEqualFold")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SourceEqualFold = data - case "sourceContainsFold": + it.NameEqualFold = data + case "nameContainsFold": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceContainsFold")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SourceContainsFold = data - case "hasLoadBalancer": + it.NameContainsFold = data + case "hasLoadBalancers": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancer")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancers")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.HasLoadBalancer = data - case "hasLoadBalancerWith": + it.HasLoadBalancers = data + case "hasLoadBalancersWith": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancerWith")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasLoadBalancersWith")) data, err := ec.unmarshalOLoadBalancerWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.HasLoadBalancerWith = data + it.HasLoadBalancersWith = data } } @@ -16979,7 +14394,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", "hasAnnotations", "hasAnnotationsWith", "hasStatuses", "hasStatusesWith", "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", "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 { @@ -17346,42 +14761,6 @@ func (ec *executionContext) unmarshalInputLoadBalancerWhereInput(ctx context.Con return it, err } it.NameContainsFold = data - case "hasAnnotations": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAnnotations")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err - } - it.HasAnnotations = data - case "hasAnnotationsWith": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAnnotationsWith")) - data, err := ec.unmarshalOLoadBalancerAnnotationWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationWhereInputᚄ(ctx, v) - if err != nil { - return it, err - } - it.HasAnnotationsWith = data - case "hasStatuses": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatuses")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err - } - it.HasStatuses = data - case "hasStatusesWith": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatusesWith")) - data, err := ec.unmarshalOLoadBalancerStatusWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusWhereInputᚄ(ctx, v) - if err != nil { - return it, err - } - it.HasStatusesWith = data case "hasPorts": var err error @@ -17726,7 +15105,7 @@ func (ec *executionContext) unmarshalInputUpdateLoadBalancerProviderInput(ctx co // region ************************** interface.gotpl *************************** -func (ec *executionContext) _IPv4Addressable(ctx context.Context, sel ast.SelectionSet, obj generated.IPv4Addressable) graphql.Marshaler { +func (ec *executionContext) _IPAddressable(ctx context.Context, sel ast.SelectionSet, obj generated.IPAddressable) graphql.Marshaler { switch obj := (obj).(type) { case nil: return graphql.Null @@ -17751,11 +15130,6 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._LoadBalancer(ctx, sel, obj) - case *generated.LoadBalancerAnnotation: - if obj == nil { - return graphql.Null - } - return ec._LoadBalancerAnnotation(ctx, sel, obj) case *generated.Origin: if obj == nil { return graphql.Null @@ -17776,11 +15150,6 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._LoadBalancerProvider(ctx, sel, obj) - case *generated.LoadBalancerStatus: - if obj == nil { - return graphql.Null - } - return ec._LoadBalancerStatus(ctx, sel, obj) default: panic(fmt.Errorf("unexpected type %T", obj)) } @@ -17797,13 +15166,6 @@ func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, return graphql.Null } return ec._LoadBalancer(ctx, sel, obj) - case generated.LoadBalancerAnnotation: - return ec._LoadBalancerAnnotation(ctx, sel, &obj) - case *generated.LoadBalancerAnnotation: - if obj == nil { - return graphql.Null - } - return ec._LoadBalancerAnnotation(ctx, sel, obj) case generated.Origin: return ec._LoadBalancerOrigin(ctx, sel, &obj) case *generated.Origin: @@ -17832,13 +15194,6 @@ func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, return graphql.Null } return ec._LoadBalancerProvider(ctx, sel, obj) - case generated.LoadBalancerStatus: - return ec._LoadBalancerStatus(ctx, sel, &obj) - case *generated.LoadBalancerStatus: - if obj == nil { - return graphql.Null - } - return ec._LoadBalancerStatus(ctx, sel, obj) case Location: return ec._Location(ctx, sel, &obj) case *Location: @@ -17846,13 +15201,13 @@ func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, return graphql.Null } return ec._Location(ctx, sel, obj) - case Owner: - return ec._Owner(ctx, sel, &obj) - case *Owner: + case ResourceOwner: + return ec._ResourceOwner(ctx, sel, &obj) + case *ResourceOwner: if obj == nil { return graphql.Null } - return ec._Owner(ctx, sel, obj) + return ec._ResourceOwner(ctx, sel, obj) default: panic(fmt.Errorf("unexpected type %T", obj)) } @@ -17871,7 +15226,7 @@ func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) g }) out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ Object: field.Name, @@ -17884,7 +15239,7 @@ func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) g case "findLoadBalancerByID": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17892,519 +15247,367 @@ func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) g }() res = ec._Entity_findLoadBalancerByID(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "findLoadBalancerAnnotationByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Entity_findLoadBalancerAnnotationByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "findLoadBalancerOriginByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Entity_findLoadBalancerOriginByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "findLoadBalancerPoolByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Entity_findLoadBalancerPoolByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "findLoadBalancerPortByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Entity_findLoadBalancerPortByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "findLoadBalancerProviderByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Entity_findLoadBalancerProviderByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "findLoadBalancerStatusByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Entity_findLoadBalancerStatusByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "findLocationByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Entity_findLocationByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "findOwnerByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Entity_findOwnerByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var loadBalancerImplementors = []string{"LoadBalancer", "Node", "IPv4Addressable", "_Entity"} - -func (ec *executionContext) _LoadBalancer(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancer) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("LoadBalancer") - case "id": - - out.Values[i] = ec._LoadBalancer_id(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "createdAt": - - out.Values[i] = ec._LoadBalancer_createdAt(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "updatedAt": - - out.Values[i] = ec._LoadBalancer_updatedAt(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "name": - - out.Values[i] = ec._LoadBalancer_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - case "annotations": + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findLoadBalancerOriginByID": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._LoadBalancer_annotations(ctx, field, obj) + res = ec._Entity_findLoadBalancerOriginByID(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } - }) - case "statuses": + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findLoadBalancerPoolByID": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._LoadBalancer_statuses(ctx, field, obj) + res = ec._Entity_findLoadBalancerPoolByID(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } - }) - case "ports": + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findLoadBalancerPortByID": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._LoadBalancer_ports(ctx, field, obj) + res = ec._Entity_findLoadBalancerPortByID(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } - }) - case "loadBalancerProvider": + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findLoadBalancerProviderByID": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._LoadBalancer_loadBalancerProvider(ctx, field, obj) + res = ec._Entity_findLoadBalancerProviderByID(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } - }) - case "location": + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findLocationByID": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._LoadBalancer_location(ctx, field, obj) + res = ec._Entity_findLocationByID(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } - }) - case "owner": + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "findResourceOwnerByID": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._LoadBalancer_owner(ctx, field, obj) + res = ec._Entity_findResourceOwnerByID(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } -var loadBalancerAnnotationImplementors = []string{"LoadBalancerAnnotation", "Node", "_Entity"} +var loadBalancerImplementors = []string{"LoadBalancer", "Node", "IPAddressable", "_Entity"} + +func (ec *executionContext) _LoadBalancer(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancer) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerImplementors) -func (ec *executionContext) _LoadBalancerAnnotation(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerAnnotation) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerAnnotationImplementors) out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("LoadBalancerAnnotation") + out.Values[i] = graphql.MarshalString("LoadBalancer") case "id": - - out.Values[i] = ec._LoadBalancerAnnotation_id(ctx, field, obj) - + out.Values[i] = ec._LoadBalancer_id(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "createdAt": - - out.Values[i] = ec._LoadBalancerAnnotation_createdAt(ctx, field, obj) - + out.Values[i] = ec._LoadBalancer_createdAt(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "updatedAt": - - out.Values[i] = ec._LoadBalancerAnnotation_updatedAt(ctx, field, obj) - + out.Values[i] = ec._LoadBalancer_updatedAt(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } - case "loadBalancerID": - - out.Values[i] = ec._LoadBalancerAnnotation_loadBalancerID(ctx, field, obj) - + case "name": + out.Values[i] = ec._LoadBalancer_name(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } - case "loadBalancer": + case "ports": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._LoadBalancerAnnotation_loadBalancer(ctx, field, obj) + res = ec._LoadBalancer_ports(ctx, field, obj) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var loadBalancerAnnotationConnectionImplementors = []string{"LoadBalancerAnnotationConnection"} + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) -func (ec *executionContext) _LoadBalancerAnnotationConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerAnnotationConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerAnnotationConnectionImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("LoadBalancerAnnotationConnection") - case "edges": + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } - out.Values[i] = ec._LoadBalancerAnnotationConnection_edges(ctx, field, obj) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "loadBalancerProvider": + field := field - case "pageInfo": + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._LoadBalancer_loadBalancerProvider(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } - out.Values[i] = ec._LoadBalancerAnnotationConnection_pageInfo(ctx, field, obj) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - if out.Values[i] == graphql.Null { - invalids++ + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "totalCount": - out.Values[i] = ec._LoadBalancerAnnotationConnection_totalCount(ctx, field, obj) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "location": + field := field - if out.Values[i] == graphql.Null { - invalids++ + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._LoadBalancer_location(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} -var loadBalancerAnnotationEdgeImplementors = []string{"LoadBalancerAnnotationEdge"} + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) -func (ec *executionContext) _LoadBalancerAnnotationEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerAnnotationEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerAnnotationEdgeImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("LoadBalancerAnnotationEdge") - case "node": + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } - out.Values[i] = ec._LoadBalancerAnnotationEdge_node(ctx, field, obj) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "owner": + field := field - case "cursor": + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._LoadBalancer_owner(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } - out.Values[i] = ec._LoadBalancerAnnotationEdge_cursor(ctx, field, obj) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - if out.Values[i] == graphql.Null { - invalids++ + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18412,38 +15615,45 @@ var loadBalancerConnectionImplementors = []string{"LoadBalancerConnection"} func (ec *executionContext) _LoadBalancerConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerConnection) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerConnectionImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerConnection") case "edges": - out.Values[i] = ec._LoadBalancerConnection_edges(ctx, field, obj) - case "pageInfo": - out.Values[i] = ec._LoadBalancerConnection_pageInfo(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "totalCount": - out.Values[i] = ec._LoadBalancerConnection_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18451,27 +15661,38 @@ var loadBalancerCreatePayloadImplementors = []string{"LoadBalancerCreatePayload" func (ec *executionContext) _LoadBalancerCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerCreatePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerCreatePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerCreatePayload") case "loadBalancer": - out.Values[i] = ec._LoadBalancerCreatePayload_loadBalancer(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18479,27 +15700,38 @@ var loadBalancerDeletePayloadImplementors = []string{"LoadBalancerDeletePayload" func (ec *executionContext) _LoadBalancerDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerDeletePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerDeletePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerDeletePayload") case "deletedID": - out.Values[i] = ec._LoadBalancerDeletePayload_deletedID(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18507,31 +15739,40 @@ var loadBalancerEdgeImplementors = []string{"LoadBalancerEdge"} func (ec *executionContext) _LoadBalancerEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerEdge) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerEdgeImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerEdge") case "node": - out.Values[i] = ec._LoadBalancerEdge_node(ctx, field, obj) - case "cursor": - out.Values[i] = ec._LoadBalancerEdge_cursor(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18539,72 +15780,57 @@ var loadBalancerOriginImplementors = []string{"LoadBalancerOrigin", "Node", "_En func (ec *executionContext) _LoadBalancerOrigin(ctx context.Context, sel ast.SelectionSet, obj *generated.Origin) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerOriginImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerOrigin") case "id": - out.Values[i] = ec._LoadBalancerOrigin_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "createdAt": - out.Values[i] = ec._LoadBalancerOrigin_createdAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "updatedAt": - out.Values[i] = ec._LoadBalancerOrigin_updatedAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "name": - out.Values[i] = ec._LoadBalancerOrigin_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "target": - out.Values[i] = ec._LoadBalancerOrigin_target(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "portNumber": - out.Values[i] = ec._LoadBalancerOrigin_portNumber(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "active": - out.Values[i] = ec._LoadBalancerOrigin_active(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "poolID": - out.Values[i] = ec._LoadBalancerOrigin_poolID(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "pool": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18612,23 +15838,51 @@ func (ec *executionContext) _LoadBalancerOrigin(ctx context.Context, sel ast.Sel }() res = ec._LoadBalancerOrigin_pool(ctx, field, obj) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - }) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18636,38 +15890,45 @@ var loadBalancerOriginConnectionImplementors = []string{"LoadBalancerOriginConne func (ec *executionContext) _LoadBalancerOriginConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerOriginConnection) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerOriginConnectionImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerOriginConnection") case "edges": - out.Values[i] = ec._LoadBalancerOriginConnection_edges(ctx, field, obj) - case "pageInfo": - out.Values[i] = ec._LoadBalancerOriginConnection_pageInfo(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "totalCount": - out.Values[i] = ec._LoadBalancerOriginConnection_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18675,27 +15936,38 @@ var loadBalancerOriginCreatePayloadImplementors = []string{"LoadBalancerOriginCr func (ec *executionContext) _LoadBalancerOriginCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerOriginCreatePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerOriginCreatePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerOriginCreatePayload") case "loadBalancerOrigin": - out.Values[i] = ec._LoadBalancerOriginCreatePayload_loadBalancerOrigin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18703,27 +15975,38 @@ var loadBalancerOriginDeletePayloadImplementors = []string{"LoadBalancerOriginDe func (ec *executionContext) _LoadBalancerOriginDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerOriginDeletePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerOriginDeletePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerOriginDeletePayload") case "deletedID": - out.Values[i] = ec._LoadBalancerOriginDeletePayload_deletedID(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18731,31 +16014,40 @@ var loadBalancerOriginEdgeImplementors = []string{"LoadBalancerOriginEdge"} func (ec *executionContext) _LoadBalancerOriginEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerOriginEdge) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerOriginEdgeImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerOriginEdge") case "node": - out.Values[i] = ec._LoadBalancerOriginEdge_node(ctx, field, obj) - case "cursor": - out.Values[i] = ec._LoadBalancerOriginEdge_cursor(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18763,27 +16055,38 @@ var loadBalancerOriginUpdatePayloadImplementors = []string{"LoadBalancerOriginUp func (ec *executionContext) _LoadBalancerOriginUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerOriginUpdatePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerOriginUpdatePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerOriginUpdatePayload") case "loadBalancerOrigin": - out.Values[i] = ec._LoadBalancerOriginUpdatePayload_loadBalancerOrigin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18791,58 +16094,47 @@ var loadBalancerPoolImplementors = []string{"LoadBalancerPool", "Node", "_Entity func (ec *executionContext) _LoadBalancerPool(ctx context.Context, sel ast.SelectionSet, obj *generated.Pool) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPoolImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPool") case "id": - out.Values[i] = ec._LoadBalancerPool_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "createdAt": - out.Values[i] = ec._LoadBalancerPool_createdAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "updatedAt": - out.Values[i] = ec._LoadBalancerPool_updatedAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "name": - out.Values[i] = ec._LoadBalancerPool_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "protocol": - out.Values[i] = ec._LoadBalancerPool_protocol(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "ownerID": - out.Values[i] = ec._LoadBalancerPool_ownerID(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "ports": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18852,14 +16144,30 @@ func (ec *executionContext) _LoadBalancerPool(ctx context.Context, sel ast.Selec return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - }) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "origins": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18867,19 +16175,35 @@ func (ec *executionContext) _LoadBalancerPool(ctx context.Context, sel ast.Selec }() res = ec._LoadBalancerPool_origins(ctx, field, obj) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - }) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "owner": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18887,23 +16211,51 @@ func (ec *executionContext) _LoadBalancerPool(ctx context.Context, sel ast.Selec }() res = ec._LoadBalancerPool_owner(ctx, field, obj) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - }) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18911,38 +16263,45 @@ var loadBalancerPoolConnectionImplementors = []string{"LoadBalancerPoolConnectio func (ec *executionContext) _LoadBalancerPoolConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerPoolConnection) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPoolConnectionImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPoolConnection") case "edges": - out.Values[i] = ec._LoadBalancerPoolConnection_edges(ctx, field, obj) - case "pageInfo": - out.Values[i] = ec._LoadBalancerPoolConnection_pageInfo(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "totalCount": - out.Values[i] = ec._LoadBalancerPoolConnection_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18950,27 +16309,38 @@ var loadBalancerPoolCreatePayloadImplementors = []string{"LoadBalancerPoolCreate func (ec *executionContext) _LoadBalancerPoolCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerPoolCreatePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPoolCreatePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPoolCreatePayload") case "loadBalancerPool": - out.Values[i] = ec._LoadBalancerPoolCreatePayload_loadBalancerPool(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -18978,24 +16348,35 @@ var loadBalancerPoolDeletePayloadImplementors = []string{"LoadBalancerPoolDelete func (ec *executionContext) _LoadBalancerPoolDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerPoolDeletePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPoolDeletePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPoolDeletePayload") case "deletedID": - out.Values[i] = ec._LoadBalancerPoolDeletePayload_deletedID(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19003,31 +16384,40 @@ var loadBalancerPoolEdgeImplementors = []string{"LoadBalancerPoolEdge"} func (ec *executionContext) _LoadBalancerPoolEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerPoolEdge) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPoolEdgeImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPoolEdge") case "node": - out.Values[i] = ec._LoadBalancerPoolEdge_node(ctx, field, obj) - case "cursor": - out.Values[i] = ec._LoadBalancerPoolEdge_cursor(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19035,27 +16425,38 @@ var loadBalancerPoolUpdatePayloadImplementors = []string{"LoadBalancerPoolUpdate func (ec *executionContext) _LoadBalancerPoolUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerPoolUpdatePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPoolUpdatePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPoolUpdatePayload") case "loadBalancerPool": - out.Values[i] = ec._LoadBalancerPoolUpdatePayload_loadBalancerPool(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19063,58 +16464,47 @@ var loadBalancerPortImplementors = []string{"LoadBalancerPort", "Node", "_Entity func (ec *executionContext) _LoadBalancerPort(ctx context.Context, sel ast.SelectionSet, obj *generated.Port) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPortImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPort") case "id": - out.Values[i] = ec._LoadBalancerPort_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "createdAt": - out.Values[i] = ec._LoadBalancerPort_createdAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "updatedAt": - out.Values[i] = ec._LoadBalancerPort_updatedAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "number": - out.Values[i] = ec._LoadBalancerPort_number(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "name": - out.Values[i] = ec._LoadBalancerPort_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "loadBalancerID": - out.Values[i] = ec._LoadBalancerPort_loadBalancerID(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "pools": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -19124,14 +16514,30 @@ func (ec *executionContext) _LoadBalancerPort(ctx context.Context, sel ast.Selec return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - }) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "loadBalancer": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -19139,23 +16545,51 @@ func (ec *executionContext) _LoadBalancerPort(ctx context.Context, sel ast.Selec }() res = ec._LoadBalancerPort_loadBalancer(ctx, field, obj) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - }) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19163,38 +16597,45 @@ var loadBalancerPortConnectionImplementors = []string{"LoadBalancerPortConnectio func (ec *executionContext) _LoadBalancerPortConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerPortConnection) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPortConnectionImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPortConnection") case "edges": - out.Values[i] = ec._LoadBalancerPortConnection_edges(ctx, field, obj) - case "pageInfo": - out.Values[i] = ec._LoadBalancerPortConnection_pageInfo(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "totalCount": - out.Values[i] = ec._LoadBalancerPortConnection_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19202,27 +16643,38 @@ var loadBalancerPortCreatePayloadImplementors = []string{"LoadBalancerPortCreate func (ec *executionContext) _LoadBalancerPortCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerPortCreatePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPortCreatePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPortCreatePayload") case "loadBalancerPort": - out.Values[i] = ec._LoadBalancerPortCreatePayload_loadBalancerPort(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19230,27 +16682,38 @@ var loadBalancerPortDeletePayloadImplementors = []string{"LoadBalancerPortDelete func (ec *executionContext) _LoadBalancerPortDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerPortDeletePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPortDeletePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPortDeletePayload") case "deletedID": - out.Values[i] = ec._LoadBalancerPortDeletePayload_deletedID(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19258,31 +16721,40 @@ var loadBalancerPortEdgeImplementors = []string{"LoadBalancerPortEdge"} func (ec *executionContext) _LoadBalancerPortEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerPortEdge) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPortEdgeImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPortEdge") case "node": - out.Values[i] = ec._LoadBalancerPortEdge_node(ctx, field, obj) - case "cursor": - out.Values[i] = ec._LoadBalancerPortEdge_cursor(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19290,27 +16762,38 @@ var loadBalancerPortUpdatePayloadImplementors = []string{"LoadBalancerPortUpdate func (ec *executionContext) _LoadBalancerPortUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerPortUpdatePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerPortUpdatePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerPortUpdatePayload") case "loadBalancerPort": - out.Values[i] = ec._LoadBalancerPortUpdatePayload_loadBalancerPort(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19318,44 +16801,37 @@ var loadBalancerProviderImplementors = []string{"LoadBalancerProvider", "Node", func (ec *executionContext) _LoadBalancerProvider(ctx context.Context, sel ast.SelectionSet, obj *generated.Provider) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerProviderImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerProvider") case "id": - out.Values[i] = ec._LoadBalancerProvider_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "createdAt": - out.Values[i] = ec._LoadBalancerProvider_createdAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "updatedAt": - out.Values[i] = ec._LoadBalancerProvider_updatedAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "name": - out.Values[i] = ec._LoadBalancerProvider_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "loadBalancers": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -19363,19 +16839,35 @@ func (ec *executionContext) _LoadBalancerProvider(ctx context.Context, sel ast.S }() res = ec._LoadBalancerProvider_loadBalancers(ctx, field, obj) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - }) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "owner": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -19383,23 +16875,51 @@ func (ec *executionContext) _LoadBalancerProvider(ctx context.Context, sel ast.S }() res = ec._LoadBalancerProvider_owner(ctx, field, obj) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - }) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19407,301 +16927,203 @@ var loadBalancerProviderConnectionImplementors = []string{"LoadBalancerProviderC func (ec *executionContext) _LoadBalancerProviderConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerProviderConnection) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerProviderConnectionImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerProviderConnection") case "edges": - out.Values[i] = ec._LoadBalancerProviderConnection_edges(ctx, field, obj) - case "pageInfo": - out.Values[i] = ec._LoadBalancerProviderConnection_pageInfo(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "totalCount": - - out.Values[i] = ec._LoadBalancerProviderConnection_totalCount(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var loadBalancerProviderCreatePayloadImplementors = []string{"LoadBalancerProviderCreatePayload"} - -func (ec *executionContext) _LoadBalancerProviderCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerProviderCreatePayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerProviderCreatePayloadImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("LoadBalancerProviderCreatePayload") - case "loadBalancerProvider": - - out.Values[i] = ec._LoadBalancerProviderCreatePayload_loadBalancerProvider(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var loadBalancerProviderDeletePayloadImplementors = []string{"LoadBalancerProviderDeletePayload"} - -func (ec *executionContext) _LoadBalancerProviderDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerProviderDeletePayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerProviderDeletePayloadImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("LoadBalancerProviderDeletePayload") - case "deletedID": - - out.Values[i] = ec._LoadBalancerProviderDeletePayload_deletedID(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var loadBalancerProviderEdgeImplementors = []string{"LoadBalancerProviderEdge"} - -func (ec *executionContext) _LoadBalancerProviderEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerProviderEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerProviderEdgeImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("LoadBalancerProviderEdge") - case "node": - - out.Values[i] = ec._LoadBalancerProviderEdge_node(ctx, field, obj) - - case "cursor": - - out.Values[i] = ec._LoadBalancerProviderEdge_cursor(ctx, field, obj) - + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._LoadBalancerProviderConnection_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } -var loadBalancerProviderUpdatePayloadImplementors = []string{"LoadBalancerProviderUpdatePayload"} +var loadBalancerProviderCreatePayloadImplementors = []string{"LoadBalancerProviderCreatePayload"} + +func (ec *executionContext) _LoadBalancerProviderCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerProviderCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerProviderCreatePayloadImplementors) -func (ec *executionContext) _LoadBalancerProviderUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerProviderUpdatePayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerProviderUpdatePayloadImplementors) out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("LoadBalancerProviderUpdatePayload") + out.Values[i] = graphql.MarshalString("LoadBalancerProviderCreatePayload") case "loadBalancerProvider": - - out.Values[i] = ec._LoadBalancerProviderUpdatePayload_loadBalancerProvider(ctx, field, obj) - + out.Values[i] = ec._LoadBalancerProviderCreatePayload_loadBalancerProvider(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } -var loadBalancerStatusImplementors = []string{"LoadBalancerStatus", "Node", "_Entity"} +var loadBalancerProviderDeletePayloadImplementors = []string{"LoadBalancerProviderDeletePayload"} + +func (ec *executionContext) _LoadBalancerProviderDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerProviderDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerProviderDeletePayloadImplementors) -func (ec *executionContext) _LoadBalancerStatus(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerStatus) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerStatusImplementors) out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("LoadBalancerStatus") - case "id": - - out.Values[i] = ec._LoadBalancerStatus_id(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "createdAt": - - out.Values[i] = ec._LoadBalancerStatus_createdAt(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "updatedAt": - - out.Values[i] = ec._LoadBalancerStatus_updatedAt(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "loadBalancerID": - - out.Values[i] = ec._LoadBalancerStatus_loadBalancerID(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "source": - - out.Values[i] = ec._LoadBalancerStatus_source(ctx, field, obj) - + out.Values[i] = graphql.MarshalString("LoadBalancerProviderDeletePayload") + case "deletedID": + out.Values[i] = ec._LoadBalancerProviderDeletePayload_deletedID(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "loadBalancer": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._LoadBalancerStatus_loadBalancer(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res + out.Invalids++ } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } -var loadBalancerStatusConnectionImplementors = []string{"LoadBalancerStatusConnection"} +var loadBalancerProviderEdgeImplementors = []string{"LoadBalancerProviderEdge"} + +func (ec *executionContext) _LoadBalancerProviderEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerProviderEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerProviderEdgeImplementors) -func (ec *executionContext) _LoadBalancerStatusConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerStatusConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerStatusConnectionImplementors) out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("LoadBalancerStatusConnection") - case "edges": - - out.Values[i] = ec._LoadBalancerStatusConnection_edges(ctx, field, obj) - - case "pageInfo": - - out.Values[i] = ec._LoadBalancerStatusConnection_pageInfo(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "totalCount": - - out.Values[i] = ec._LoadBalancerStatusConnection_totalCount(ctx, field, obj) - + out.Values[i] = graphql.MarshalString("LoadBalancerProviderEdge") + case "node": + out.Values[i] = ec._LoadBalancerProviderEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._LoadBalancerProviderEdge_cursor(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } -var loadBalancerStatusEdgeImplementors = []string{"LoadBalancerStatusEdge"} +var loadBalancerProviderUpdatePayloadImplementors = []string{"LoadBalancerProviderUpdatePayload"} + +func (ec *executionContext) _LoadBalancerProviderUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerProviderUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerProviderUpdatePayloadImplementors) -func (ec *executionContext) _LoadBalancerStatusEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.LoadBalancerStatusEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerStatusEdgeImplementors) out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("LoadBalancerStatusEdge") - case "node": - - out.Values[i] = ec._LoadBalancerStatusEdge_node(ctx, field, obj) - - case "cursor": - - out.Values[i] = ec._LoadBalancerStatusEdge_cursor(ctx, field, obj) - + out.Values[i] = graphql.MarshalString("LoadBalancerProviderUpdatePayload") + case "loadBalancerProvider": + out.Values[i] = ec._LoadBalancerProviderUpdatePayload_loadBalancerProvider(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19709,27 +17131,38 @@ var loadBalancerUpdatePayloadImplementors = []string{"LoadBalancerUpdatePayload" func (ec *executionContext) _LoadBalancerUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *LoadBalancerUpdatePayload) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, loadBalancerUpdatePayloadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LoadBalancerUpdatePayload") case "loadBalancer": - out.Values[i] = ec._LoadBalancerUpdatePayload_loadBalancer(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19737,23 +17170,22 @@ var locationImplementors = []string{"Location", "_Entity"} func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, obj *Location) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, locationImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Location") case "id": - out.Values[i] = ec._Location_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&out.Invalids, 1) } case "loadBalancers": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -19761,23 +17193,51 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, }() res = ec._Location_loadBalancers(ctx, field, obj) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - }) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -19790,7 +17250,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) }) out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ Object: field.Name, @@ -19800,237 +17260,131 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Mutation") - case "loadBalancerCreate": - + case "loadBalancerOriginCreate": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_loadBalancerCreate(ctx, field) + return ec._Mutation_loadBalancerOriginCreate(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } - case "loadBalancerUpdate": - + case "loadBalancerOriginUpdate": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_loadBalancerUpdate(ctx, field) + return ec._Mutation_loadBalancerOriginUpdate(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } - case "loadBalancerDelete": - + case "loadBalancerOriginDelete": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_loadBalancerDelete(ctx, field) + return ec._Mutation_loadBalancerOriginDelete(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } - case "loadBalancerOriginCreate": - + case "loadBalancerCreate": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_loadBalancerOriginCreate(ctx, field) + return ec._Mutation_loadBalancerCreate(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } - case "loadBalancerOriginUpdate": - + case "loadBalancerUpdate": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_loadBalancerOriginUpdate(ctx, field) + return ec._Mutation_loadBalancerUpdate(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } - case "loadBalancerOriginDelete": - + case "loadBalancerDelete": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_loadBalancerOriginDelete(ctx, field) + return ec._Mutation_loadBalancerDelete(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "loadBalancerPoolCreate": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_loadBalancerPoolCreate(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "loadBalancerPoolUpdate": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_loadBalancerPoolUpdate(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "loadBalancerPoolDelete": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_loadBalancerPoolDelete(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "loadBalancerPortCreate": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_loadBalancerPortCreate(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "loadBalancerPortUpdate": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_loadBalancerPortUpdate(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "loadBalancerPortDelete": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_loadBalancerPortDelete(ctx, field) }) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "loadBalancerProviderCreate": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_loadBalancerProviderCreate(ctx, field) - }) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "loadBalancerProviderUpdate": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_loadBalancerProviderUpdate(ctx, field) - }) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "loadBalancerProviderDelete": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_loadBalancerProviderDelete(ctx, field) - }) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var ownerImplementors = []string{"Owner", "_Entity"} - -func (ec *executionContext) _Owner(ctx context.Context, sel ast.SelectionSet, obj *Owner) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, ownerImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Owner") - case "id": - - out.Values[i] = ec._Owner_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "loadBalancers": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Owner_loadBalancers(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "loadBalancerPools": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Owner_loadBalancerPools(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res + out.Invalids++ } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - + case "loadBalancerProviderCreate": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_loadBalancerProviderCreate(ctx, field) }) - case "loadBalancersProviders": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Owner_loadBalancersProviders(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res + if out.Values[i] == graphql.Null { + out.Invalids++ } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - + case "loadBalancerProviderUpdate": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_loadBalancerProviderUpdate(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "loadBalancerProviderDelete": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_loadBalancerProviderDelete(ctx, field) }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -20038,42 +17392,47 @@ var pageInfoImplementors = []string{"PageInfo"} func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *entgql.PageInfo[gidx.PrefixedID]) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, pageInfoImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("PageInfo") case "hasNextPage": - out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "hasPreviousPage": - out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "startCursor": - out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) - case "endCursor": - out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -20086,7 +17445,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }) out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ Object: field.Name, @@ -20099,7 +17458,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "loadBalancerPools": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -20107,22 +17466,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_loadBalancerPools(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "loadBalancer": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -20130,22 +17488,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_loadBalancer(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "loadBalancerPool": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -20153,22 +17510,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_loadBalancerPool(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "loadBalancerProvider": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -20176,22 +17532,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_loadBalancerProvider(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "_entities": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -20199,22 +17554,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query__entities(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "_service": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -20222,38 +17576,192 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query__service(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "__type": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___type(ctx, field) }) - case "__schema": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___schema(ctx, field) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var resourceOwnerImplementors = []string{"ResourceOwner", "_Entity"} + +func (ec *executionContext) _ResourceOwner(ctx context.Context, sel ast.SelectionSet, obj *ResourceOwner) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, resourceOwnerImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ResourceOwner") + case "id": + out.Values[i] = ec._ResourceOwner_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "loadBalancers": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ResourceOwner_loadBalancers(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "loadBalancerPools": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ResourceOwner_loadBalancerPools(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "loadBalancersProviders": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ResourceOwner_loadBalancersProviders(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -20261,24 +17769,35 @@ var _ServiceImplementors = []string{"_Service"} func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("_Service") case "sdl": - out.Values[i] = ec.__Service_sdl(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -20286,52 +17805,55 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - out.Values[i] = ec.___Directive_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "description": - out.Values[i] = ec.___Directive_description(ctx, field, obj) - case "locations": - out.Values[i] = ec.___Directive_locations(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "args": - out.Values[i] = ec.___Directive_args(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "isRepeatable": - out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -20339,42 +17861,47 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - out.Values[i] = ec.___EnumValue_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "description": - out.Values[i] = ec.___EnumValue_description(ctx, field, obj) - case "isDeprecated": - out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "deprecationReason": - out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -20382,56 +17909,57 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - out.Values[i] = ec.___Field_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "description": - out.Values[i] = ec.___Field_description(ctx, field, obj) - case "args": - out.Values[i] = ec.___Field_args(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "type": - out.Values[i] = ec.___Field_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "isDeprecated": - out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "deprecationReason": - out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -20439,42 +17967,47 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - out.Values[i] = ec.___InputValue_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "description": - out.Values[i] = ec.___InputValue_description(ctx, field, obj) - case "type": - out.Values[i] = ec.___InputValue_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "defaultValue": - out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -20482,53 +18015,54 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - out.Values[i] = ec.___Schema_description(ctx, field, obj) - case "types": - out.Values[i] = ec.___Schema_types(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "queryType": - out.Values[i] = ec.___Schema_queryType(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "mutationType": - out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) - case "subscriptionType": - out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) - case "directives": - out.Values[i] = ec.___Schema_directives(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -20536,63 +18070,56 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - out.Values[i] = ec.___Type_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "name": - out.Values[i] = ec.___Type_name(ctx, field, obj) - case "description": - out.Values[i] = ec.___Type_description(ctx, field, obj) - case "fields": - out.Values[i] = ec.___Type_fields(ctx, field, obj) - case "interfaces": - out.Values[i] = ec.___Type_interfaces(ctx, field, obj) - case "possibleTypes": - out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) - case "enumValues": - out.Values[i] = ec.___Type_enumValues(ctx, field, obj) - case "inputFields": - out.Values[i] = ec.___Type_inputFields(ctx, field, obj) - case "ofType": - out.Values[i] = ec.___Type_ofType(ctx, field, obj) - case "specifiedByURL": - out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -20646,8 +18173,23 @@ func (ec *executionContext) unmarshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCur return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx context.Context, sel ast.SelectionSet, v entgql.Cursor[gidx.PrefixedID]) graphql.Marshaler { - return v +func (ec *executionContext) marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx context.Context, sel ast.SelectionSet, v entgql.Cursor[gidx.PrefixedID]) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNFieldSet2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res } func (ec *executionContext) unmarshalNID2goᚗinfratographerᚗcomᚋxᚋgidxᚐPrefixedID(ctx context.Context, v interface{}) (gidx.PrefixedID, error) { @@ -20689,51 +18231,6 @@ func (ec *executionContext) marshalNLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋ return ec._LoadBalancer(ctx, sel, v) } -func (ec *executionContext) marshalNLoadBalancerAnnotation2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotation(ctx context.Context, sel ast.SelectionSet, v generated.LoadBalancerAnnotation) graphql.Marshaler { - return ec._LoadBalancerAnnotation(ctx, sel, &v) -} - -func (ec *executionContext) marshalNLoadBalancerAnnotation2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotation(ctx context.Context, sel ast.SelectionSet, v *generated.LoadBalancerAnnotation) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._LoadBalancerAnnotation(ctx, sel, v) -} - -func (ec *executionContext) marshalNLoadBalancerAnnotationConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationConnection(ctx context.Context, sel ast.SelectionSet, v *generated.LoadBalancerAnnotationConnection) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._LoadBalancerAnnotationConnection(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNLoadBalancerAnnotationOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationOrderField(ctx context.Context, v interface{}) (*generated.LoadBalancerAnnotationOrderField, error) { - var res = new(generated.LoadBalancerAnnotationOrderField) - err := res.UnmarshalGQL(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNLoadBalancerAnnotationOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.LoadBalancerAnnotationOrderField) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return v -} - -func (ec *executionContext) unmarshalNLoadBalancerAnnotationWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationWhereInput(ctx context.Context, v interface{}) (*generated.LoadBalancerAnnotationWhereInput, error) { - res, err := ec.unmarshalInputLoadBalancerAnnotationWhereInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalNLoadBalancerConnection2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerConnection(ctx context.Context, sel ast.SelectionSet, v generated.LoadBalancerConnection) graphql.Marshaler { return ec._LoadBalancerConnection(ctx, sel, &v) } @@ -21158,51 +18655,6 @@ func (ec *executionContext) unmarshalNLoadBalancerProviderWhereInput2ᚖgoᚗinf return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNLoadBalancerStatus2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatus(ctx context.Context, sel ast.SelectionSet, v generated.LoadBalancerStatus) graphql.Marshaler { - return ec._LoadBalancerStatus(ctx, sel, &v) -} - -func (ec *executionContext) marshalNLoadBalancerStatus2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatus(ctx context.Context, sel ast.SelectionSet, v *generated.LoadBalancerStatus) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._LoadBalancerStatus(ctx, sel, v) -} - -func (ec *executionContext) marshalNLoadBalancerStatusConnection2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusConnection(ctx context.Context, sel ast.SelectionSet, v *generated.LoadBalancerStatusConnection) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._LoadBalancerStatusConnection(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNLoadBalancerStatusOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusOrderField(ctx context.Context, v interface{}) (*generated.LoadBalancerStatusOrderField, error) { - var res = new(generated.LoadBalancerStatusOrderField) - err := res.UnmarshalGQL(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNLoadBalancerStatusOrderField2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.LoadBalancerStatusOrderField) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return v -} - -func (ec *executionContext) unmarshalNLoadBalancerStatusWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusWhereInput(ctx context.Context, v interface{}) (*generated.LoadBalancerStatusWhereInput, error) { - res, err := ec.unmarshalInputLoadBalancerStatusWhereInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalNLoadBalancerUpdatePayload2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐLoadBalancerUpdatePayload(ctx context.Context, sel ast.SelectionSet, v LoadBalancerUpdatePayload) graphql.Marshaler { return ec._LoadBalancerUpdatePayload(ctx, sel, &v) } @@ -21246,22 +18698,22 @@ func (ec *executionContext) marshalNOrderDirection2entgoᚗioᚋcontribᚋentgql return v } -func (ec *executionContext) marshalNOwner2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐOwner(ctx context.Context, sel ast.SelectionSet, v Owner) graphql.Marshaler { - return ec._Owner(ctx, sel, &v) +func (ec *executionContext) marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v entgql.PageInfo[gidx.PrefixedID]) graphql.Marshaler { + return ec._PageInfo(ctx, sel, &v) +} + +func (ec *executionContext) marshalNResourceOwner2goᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐResourceOwner(ctx context.Context, sel ast.SelectionSet, v ResourceOwner) graphql.Marshaler { + return ec._ResourceOwner(ctx, sel, &v) } -func (ec *executionContext) marshalNOwner2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐOwner(ctx context.Context, sel ast.SelectionSet, v *Owner) graphql.Marshaler { +func (ec *executionContext) marshalNResourceOwner2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋgraphapiᚐResourceOwner(ctx context.Context, sel ast.SelectionSet, v *ResourceOwner) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._Owner(ctx, sel, v) -} - -func (ec *executionContext) marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v entgql.PageInfo[gidx.PrefixedID]) graphql.Marshaler { - return ec._PageInfo(ctx, sel, &v) + return ec._ResourceOwner(ctx, sel, v) } func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { @@ -21410,21 +18862,6 @@ func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgen return ret } -func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN_FieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { return ec.__Service(ctx, sel, &v) } @@ -21839,97 +19276,6 @@ func (ec *executionContext) marshalOLoadBalancer2ᚖgoᚗinfratographerᚗcomᚋ return ec._LoadBalancer(ctx, sel, v) } -func (ec *executionContext) marshalOLoadBalancerAnnotation2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotation(ctx context.Context, sel ast.SelectionSet, v *generated.LoadBalancerAnnotation) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._LoadBalancerAnnotation(ctx, sel, v) -} - -func (ec *executionContext) marshalOLoadBalancerAnnotationEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.LoadBalancerAnnotationEdge) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalOLoadBalancerAnnotationEdge2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationEdge(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - return ret -} - -func (ec *executionContext) marshalOLoadBalancerAnnotationEdge2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationEdge(ctx context.Context, sel ast.SelectionSet, v *generated.LoadBalancerAnnotationEdge) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._LoadBalancerAnnotationEdge(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOLoadBalancerAnnotationOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationOrder(ctx context.Context, v interface{}) (*generated.LoadBalancerAnnotationOrder, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputLoadBalancerAnnotationOrder(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalOLoadBalancerAnnotationWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.LoadBalancerAnnotationWhereInput, error) { - if v == nil { - return nil, nil - } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]*generated.LoadBalancerAnnotationWhereInput, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNLoadBalancerAnnotationWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationWhereInput(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) unmarshalOLoadBalancerAnnotationWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerAnnotationWhereInput(ctx context.Context, v interface{}) (*generated.LoadBalancerAnnotationWhereInput, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputLoadBalancerAnnotationWhereInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalOLoadBalancerEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.LoadBalancerEdge) graphql.Marshaler { if v == nil { return graphql.Null @@ -22519,97 +19865,6 @@ func (ec *executionContext) unmarshalOLoadBalancerProviderWhereInput2ᚖgoᚗinf return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOLoadBalancerStatus2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatus(ctx context.Context, sel ast.SelectionSet, v *generated.LoadBalancerStatus) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._LoadBalancerStatus(ctx, sel, v) -} - -func (ec *executionContext) marshalOLoadBalancerStatusEdge2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.LoadBalancerStatusEdge) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalOLoadBalancerStatusEdge2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusEdge(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - return ret -} - -func (ec *executionContext) marshalOLoadBalancerStatusEdge2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusEdge(ctx context.Context, sel ast.SelectionSet, v *generated.LoadBalancerStatusEdge) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._LoadBalancerStatusEdge(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOLoadBalancerStatusOrder2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusOrder(ctx context.Context, v interface{}) (*generated.LoadBalancerStatusOrder, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputLoadBalancerStatusOrder(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalOLoadBalancerStatusWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.LoadBalancerStatusWhereInput, error) { - if v == nil { - return nil, nil - } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]*generated.LoadBalancerStatusWhereInput, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNLoadBalancerStatusWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusWhereInput(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) unmarshalOLoadBalancerStatusWhereInput2ᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerStatusWhereInput(ctx context.Context, v interface{}) (*generated.LoadBalancerStatusWhereInput, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputLoadBalancerStatusWhereInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) unmarshalOLoadBalancerWhereInput2ᚕᚖgoᚗinfratographerᚗcomᚋloadᚑbalancerᚑapiᚋinternalᚋentᚋgeneratedᚐLoadBalancerWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.LoadBalancerWhereInput, error) { if v == nil { return nil, nil diff --git a/internal/graphapi/loadbalancer.resolvers.go b/internal/graphapi/loadbalancer.resolvers.go index cfd46416f..1c61629f3 100644 --- a/internal/graphapi/loadbalancer.resolvers.go +++ b/internal/graphapi/loadbalancer.resolvers.go @@ -2,18 +2,17 @@ package graphapi // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.31 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" "database/sql" - "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/port" "go.infratographer.com/load-balancer-api/internal/ent/generated/predicate" + "go.infratographer.com/permissions-api/pkg/permissions" + "go.infratographer.com/x/gidx" ) // LoadBalancerCreate is the resolver for the loadBalancerCreate field. @@ -108,8 +107,3 @@ func (r *queryResolver) LoadBalancer(ctx context.Context, id gidx.PrefixedID) (* return r.client.LoadBalancer.Get(ctx, id) } - -// Mutation returns MutationResolver implementation. -func (r *Resolver) Mutation() MutationResolver { return &mutationResolver{r} } - -type mutationResolver struct{ *Resolver } diff --git a/internal/graphapi/location.resolvers.go b/internal/graphapi/location.resolvers.go index 5673ddee8..002ed5548 100644 --- a/internal/graphapi/location.resolvers.go +++ b/internal/graphapi/location.resolvers.go @@ -2,7 +2,7 @@ package graphapi // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.31 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" diff --git a/internal/graphapi/origin.resolvers.go b/internal/graphapi/origin.resolvers.go index 6fe2c8431..7d382b0b3 100644 --- a/internal/graphapi/origin.resolvers.go +++ b/internal/graphapi/origin.resolvers.go @@ -2,15 +2,14 @@ package graphapi // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.31 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" + "go.infratographer.com/load-balancer-api/internal/ent/generated" "go.infratographer.com/permissions-api/pkg/permissions" "go.infratographer.com/x/gidx" - - "go.infratographer.com/load-balancer-api/internal/ent/generated" ) // LoadBalancerOriginCreate is the resolver for the loadBalancerOriginCreate field. @@ -69,3 +68,8 @@ func (r *mutationResolver) LoadBalancerOriginDelete(ctx context.Context, id gidx return &LoadBalancerOriginDeletePayload{DeletedID: id}, nil } + +// Mutation returns MutationResolver implementation. +func (r *Resolver) Mutation() MutationResolver { return &mutationResolver{r} } + +type mutationResolver struct{ *Resolver } diff --git a/internal/graphapi/owner.resolvers.go b/internal/graphapi/owner.resolvers.go index 0d150ce00..e20740e6c 100644 --- a/internal/graphapi/owner.resolvers.go +++ b/internal/graphapi/owner.resolvers.go @@ -2,7 +2,7 @@ package graphapi // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.31 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" @@ -16,36 +16,36 @@ import ( ) // Owner is the resolver for the owner field. -func (r *loadBalancerResolver) Owner(ctx context.Context, obj *generated.LoadBalancer) (*Owner, error) { - return &Owner{ID: obj.OwnerID}, nil +func (r *loadBalancerResolver) Owner(ctx context.Context, obj *generated.LoadBalancer) (*ResourceOwner, error) { + return &ResourceOwner{ID: obj.OwnerID}, nil } // Owner is the resolver for the owner field. -func (r *loadBalancerPoolResolver) Owner(ctx context.Context, obj *generated.Pool) (*Owner, error) { - return &Owner{ID: obj.OwnerID}, nil +func (r *loadBalancerPoolResolver) Owner(ctx context.Context, obj *generated.Pool) (*ResourceOwner, error) { + return &ResourceOwner{ID: obj.OwnerID}, nil } // Owner is the resolver for the owner field. -func (r *loadBalancerProviderResolver) Owner(ctx context.Context, obj *generated.Provider) (*Owner, error) { - return &Owner{ID: obj.OwnerID}, nil +func (r *loadBalancerProviderResolver) Owner(ctx context.Context, obj *generated.Provider) (*ResourceOwner, error) { + return &ResourceOwner{ID: obj.OwnerID}, nil } // LoadBalancers is the resolver for the loadBalancers field. -func (r *ownerResolver) LoadBalancers(ctx context.Context, obj *Owner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerWhereInput) (*generated.LoadBalancerConnection, error) { +func (r *resourceOwnerResolver) LoadBalancers(ctx context.Context, obj *ResourceOwner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerWhereInput) (*generated.LoadBalancerConnection, error) { return r.client.LoadBalancer.Query().Where(loadbalancer.OwnerID(obj.ID)).Paginate(ctx, after, first, before, last, generated.WithLoadBalancerOrder(orderBy), generated.WithLoadBalancerFilter(where.Filter)) } // LoadBalancerPools is the resolver for the loadBalancerPools field. -func (r *ownerResolver) LoadBalancerPools(ctx context.Context, obj *Owner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerPoolOrder, where *generated.LoadBalancerPoolWhereInput) (*generated.LoadBalancerPoolConnection, error) { +func (r *resourceOwnerResolver) LoadBalancerPools(ctx context.Context, obj *ResourceOwner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerPoolOrder, where *generated.LoadBalancerPoolWhereInput) (*generated.LoadBalancerPoolConnection, error) { return r.client.Pool.Query().Where(pool.OwnerID(obj.ID)).Paginate(ctx, after, first, before, last, generated.WithLoadBalancerPoolOrder(orderBy), generated.WithLoadBalancerPoolFilter(where.Filter)) } // LoadBalancersProviders is the resolver for the loadBalancersProviders field. -func (r *ownerResolver) LoadBalancersProviders(ctx context.Context, obj *Owner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerProviderWhereInput) (*generated.LoadBalancerProviderConnection, error) { +func (r *resourceOwnerResolver) LoadBalancersProviders(ctx context.Context, obj *ResourceOwner, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.LoadBalancerOrder, where *generated.LoadBalancerProviderWhereInput) (*generated.LoadBalancerProviderConnection, error) { panic(fmt.Errorf("not implemented: LoadBalancersProviders - loadBalancersProviders")) } -// Owner returns OwnerResolver implementation. -func (r *Resolver) Owner() OwnerResolver { return &ownerResolver{r} } +// ResourceOwner returns ResourceOwnerResolver implementation. +func (r *Resolver) ResourceOwner() ResourceOwnerResolver { return &resourceOwnerResolver{r} } -type ownerResolver struct{ *Resolver } +type resourceOwnerResolver struct{ *Resolver } diff --git a/internal/graphapi/pool.resolvers.go b/internal/graphapi/pool.resolvers.go index 4e3875b13..d93fe8db4 100644 --- a/internal/graphapi/pool.resolvers.go +++ b/internal/graphapi/pool.resolvers.go @@ -2,7 +2,7 @@ package graphapi // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.31 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" @@ -10,12 +10,11 @@ import ( "fmt" "github.com/labstack/gommon/log" - "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/predicate" + "go.infratographer.com/permissions-api/pkg/permissions" + "go.infratographer.com/x/gidx" ) // LoadBalancerPoolCreate is the resolver for the LoadBalancerPoolCreate field. diff --git a/internal/graphapi/pool_test.go b/internal/graphapi/pool_test.go index b16f74945..5a8aeadb3 100644 --- a/internal/graphapi/pool_test.go +++ b/internal/graphapi/pool_test.go @@ -88,7 +88,7 @@ func TestMutate_PoolCreate(t *testing.T) { TestName: "create pool", Input: graphclient.CreateLoadBalancerPoolInput{ Name: "pooly", - Protocol: pool.ProtocolTCP, + Protocol: graphclient.LoadBalancerPoolProtocolTCP, OwnerID: ownerID, }, ExpectedPool: ent.LoadBalancerPool{ @@ -101,7 +101,7 @@ func TestMutate_PoolCreate(t *testing.T) { TestName: "invalid owner ID", Input: graphclient.CreateLoadBalancerPoolInput{ Name: "pooly", - Protocol: pool.ProtocolTCP, + Protocol: graphclient.LoadBalancerPoolProtocolTCP, OwnerID: "not a valid ID", }, errorMsg: "invalid id", @@ -119,7 +119,7 @@ func TestMutate_PoolCreate(t *testing.T) { TestName: "empty name", Input: graphclient.CreateLoadBalancerPoolInput{ Name: "", - Protocol: pool.ProtocolUDP, + Protocol: graphclient.LoadBalancerPoolProtocolUDP, OwnerID: ownerID, }, errorMsg: "validator failed", @@ -146,7 +146,7 @@ func TestMutate_PoolCreate(t *testing.T) { assert.Equal(t, "loadpol", createdPool.ID.Prefix()) assert.Equal(t, tt.ExpectedPool.Name, createdPool.Name) - assert.Equal(t, tt.ExpectedPool.Protocol, createdPool.Protocol) + assert.Equal(t, tt.ExpectedPool.Protocol.String(), createdPool.Protocol.String()) assert.Equal(t, tt.ExpectedPool.OwnerID, createdPool.OwnerID) }) } @@ -159,8 +159,7 @@ func TestMutate_PoolUpdate(t *testing.T) { ctx = context.WithValue(ctx, permissions.CheckerCtxKey, permissions.DefaultAllowChecker) pool1 := (&PoolBuilder{Protocol: "tcp"}).MustNew(ctx) - updateProtocolUnknown := pool.Protocol("invalid") - updateProtocolUDP := pool.ProtocolUDP + updateProtocolUDP := graphclient.LoadBalancerPoolProtocolUDP testCases := []struct { TestName string @@ -191,14 +190,6 @@ func TestMutate_PoolUpdate(t *testing.T) { OwnerID: pool1.OwnerID, }, }, - { - TestName: "invalid protocol", - Input: graphclient.UpdateLoadBalancerPoolInput{ - Name: newString("ImaPool"), - Protocol: &updateProtocolUnknown, - }, - errorMsg: "not a valid LoadBalancerPoolProtocol", - }, { TestName: "empty name", Input: graphclient.UpdateLoadBalancerPoolInput{ @@ -227,7 +218,7 @@ func TestMutate_PoolUpdate(t *testing.T) { updatedPool := updatedPoolResp.LoadBalancerPoolUpdate.LoadBalancerPool assert.Equal(t, "loadpol", updatedPool.ID.Prefix()) assert.Equal(t, tt.ExpectedPool.Name, updatedPool.Name) - assert.Equal(t, tt.ExpectedPool.Protocol, updatedPool.Protocol) + assert.Equal(t, tt.ExpectedPool.Protocol.String(), updatedPool.Protocol.String()) assert.Equal(t, tt.ExpectedPool.OwnerID, updatedPool.OwnerID) }) } diff --git a/internal/graphapi/port.resolvers.go b/internal/graphapi/port.resolvers.go index 42562121d..39abc1dba 100644 --- a/internal/graphapi/port.resolvers.go +++ b/internal/graphapi/port.resolvers.go @@ -2,15 +2,14 @@ package graphapi // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.31 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" + "go.infratographer.com/load-balancer-api/internal/ent/generated" "go.infratographer.com/permissions-api/pkg/permissions" "go.infratographer.com/x/gidx" - - "go.infratographer.com/load-balancer-api/internal/ent/generated" ) // LoadBalancerPortCreate is the resolver for the loadBalancerPortCreate field. diff --git a/internal/graphapi/provider.resolvers.go b/internal/graphapi/provider.resolvers.go index 96679da17..7ad818a13 100644 --- a/internal/graphapi/provider.resolvers.go +++ b/internal/graphapi/provider.resolvers.go @@ -2,15 +2,14 @@ package graphapi // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.31 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" + "go.infratographer.com/load-balancer-api/internal/ent/generated" "go.infratographer.com/permissions-api/pkg/permissions" "go.infratographer.com/x/gidx" - - "go.infratographer.com/load-balancer-api/internal/ent/generated" ) // LoadBalancerProviderCreate is the resolver for the loadBalancerProviderCreate field. diff --git a/internal/graphapi/tools_test.go b/internal/graphapi/tools_test.go index 6df05537b..176b69cdd 100644 --- a/internal/graphapi/tools_test.go +++ b/internal/graphapi/tools_test.go @@ -1,6 +1,3 @@ -//go:build testtools -// +build testtools - package graphapi_test import ( diff --git a/internal/graphclient/gen_client.go b/internal/graphclient/gen_client.go index 7a8d4bb0f..0ad56f449 100644 --- a/internal/graphclient/gen_client.go +++ b/internal/graphclient/gen_client.go @@ -8,8 +8,6 @@ import ( "time" "github.com/Yamashou/gqlgenc/client" - "go.infratographer.com/load-balancer-api/internal/ent/generated" - "go.infratographer.com/load-balancer-api/internal/ent/generated/pool" "go.infratographer.com/x/gidx" ) @@ -48,18 +46,18 @@ func NewClient(cli *http.Client, baseURL string, options ...client.HTTPRequestOp type Query struct { LoadBalancerPools LoadBalancerPoolConnection "json:\"loadBalancerPools\" graphql:\"loadBalancerPools\"" LoadBalancer LoadBalancer "json:\"loadBalancer\" graphql:\"loadBalancer\"" - LoadBalancerPool generated.Pool "json:\"loadBalancerPool\" graphql:\"loadBalancerPool\"" - LoadBalancerProvider generated.Provider "json:\"loadBalancerProvider\" graphql:\"loadBalancerProvider\"" + LoadBalancerPool LoadBalancerPool "json:\"loadBalancerPool\" graphql:\"loadBalancerPool\"" + LoadBalancerProvider LoadBalancerProvider "json:\"loadBalancerProvider\" graphql:\"loadBalancerProvider\"" Entities []Entity "json:\"_entities\" graphql:\"_entities\"" Service Service "json:\"_service\" graphql:\"_service\"" } type Mutation struct { - LoadBalancerCreate LoadBalancerCreatePayload "json:\"loadBalancerCreate\" graphql:\"loadBalancerCreate\"" - LoadBalancerUpdate LoadBalancerUpdatePayload "json:\"loadBalancerUpdate\" graphql:\"loadBalancerUpdate\"" - LoadBalancerDelete LoadBalancerDeletePayload "json:\"loadBalancerDelete\" graphql:\"loadBalancerDelete\"" LoadBalancerOriginCreate LoadBalancerOriginCreatePayload "json:\"loadBalancerOriginCreate\" graphql:\"loadBalancerOriginCreate\"" LoadBalancerOriginUpdate LoadBalancerOriginUpdatePayload "json:\"loadBalancerOriginUpdate\" graphql:\"loadBalancerOriginUpdate\"" LoadBalancerOriginDelete LoadBalancerOriginDeletePayload "json:\"loadBalancerOriginDelete\" graphql:\"loadBalancerOriginDelete\"" + LoadBalancerCreate LoadBalancerCreatePayload "json:\"loadBalancerCreate\" graphql:\"loadBalancerCreate\"" + LoadBalancerUpdate LoadBalancerUpdatePayload "json:\"loadBalancerUpdate\" graphql:\"loadBalancerUpdate\"" + LoadBalancerDelete LoadBalancerDeletePayload "json:\"loadBalancerDelete\" graphql:\"loadBalancerDelete\"" LoadBalancerPoolCreate LoadBalancerPoolCreatePayload "json:\"loadBalancerPoolCreate\" graphql:\"loadBalancerPoolCreate\"" LoadBalancerPoolUpdate LoadBalancerPoolUpdatePayload "json:\"loadBalancerPoolUpdate\" graphql:\"loadBalancerPoolUpdate\"" LoadBalancerPoolDelete LoadBalancerPoolDeletePayload "json:\"loadBalancerPoolDelete\" graphql:\"loadBalancerPoolDelete\"" @@ -89,12 +87,12 @@ type GetLoadBalancer struct { } type GetLoadBalancerPool struct { LoadBalancerPool struct { - ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" - Name string "json:\"name\" graphql:\"name\"" - Protocol pool.Protocol "json:\"protocol\" graphql:\"protocol\"" - OwnerID gidx.PrefixedID "json:\"ownerID\" graphql:\"ownerID\"" - CreatedAt time.Time "json:\"createdAt\" graphql:\"createdAt\"" - UpdatedAt time.Time "json:\"updatedAt\" graphql:\"updatedAt\"" + ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Protocol LoadBalancerPoolProtocol "json:\"protocol\" graphql:\"protocol\"" + OwnerID gidx.PrefixedID "json:\"ownerID\" graphql:\"ownerID\"" + CreatedAt time.Time "json:\"createdAt\" graphql:\"createdAt\"" + UpdatedAt time.Time "json:\"updatedAt\" graphql:\"updatedAt\"" } "json:\"loadBalancerPool\" graphql:\"loadBalancerPool\"" } type GetLoadBalancerPoolOrigin struct { @@ -215,12 +213,12 @@ type LoadBalancerOriginUpdate struct { type LoadBalancerPoolCreate struct { LoadBalancerPoolCreate struct { LoadBalancerPool struct { - ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" - Name string "json:\"name\" graphql:\"name\"" - Protocol pool.Protocol "json:\"protocol\" graphql:\"protocol\"" - OwnerID gidx.PrefixedID "json:\"ownerID\" graphql:\"ownerID\"" - CreatedAt time.Time "json:\"createdAt\" graphql:\"createdAt\"" - UpdatedAt time.Time "json:\"updatedAt\" graphql:\"updatedAt\"" + ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Protocol LoadBalancerPoolProtocol "json:\"protocol\" graphql:\"protocol\"" + OwnerID gidx.PrefixedID "json:\"ownerID\" graphql:\"ownerID\"" + CreatedAt time.Time "json:\"createdAt\" graphql:\"createdAt\"" + UpdatedAt time.Time "json:\"updatedAt\" graphql:\"updatedAt\"" } "json:\"loadBalancerPool\" graphql:\"loadBalancerPool\"" } "json:\"loadBalancerPoolCreate\" graphql:\"loadBalancerPoolCreate\"" } @@ -232,12 +230,12 @@ type LoadBalancerPoolDelete struct { type LoadBalancerPoolUpdate struct { LoadBalancerPoolUpdate struct { LoadBalancerPool struct { - ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" - Name string "json:\"name\" graphql:\"name\"" - Protocol pool.Protocol "json:\"protocol\" graphql:\"protocol\"" - OwnerID gidx.PrefixedID "json:\"ownerID\" graphql:\"ownerID\"" - CreatedAt time.Time "json:\"createdAt\" graphql:\"createdAt\"" - UpdatedAt time.Time "json:\"updatedAt\" graphql:\"updatedAt\"" + ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Protocol LoadBalancerPoolProtocol "json:\"protocol\" graphql:\"protocol\"" + OwnerID gidx.PrefixedID "json:\"ownerID\" graphql:\"ownerID\"" + CreatedAt time.Time "json:\"createdAt\" graphql:\"createdAt\"" + UpdatedAt time.Time "json:\"updatedAt\" graphql:\"updatedAt\"" } "json:\"loadBalancerPool\" graphql:\"loadBalancerPool\"" } "json:\"loadBalancerPoolUpdate\" graphql:\"loadBalancerPoolUpdate\"" } @@ -461,8 +459,8 @@ func (c *Client) GetLoadBalancerProvider(ctx context.Context, id gidx.PrefixedID } const GetOwnerLoadBalancersDocument = `query GetOwnerLoadBalancers ($id: ID!, $orderBy: LoadBalancerOrder) { - _entities(representations: {__typename:"Owner",id:$id}) { - ... on Owner { + _entities(representations: {__typename:"ResourceOwner",id:$id}) { + ... on ResourceOwner { loadBalancers(orderBy: $orderBy) { edges { node { diff --git a/internal/graphclient/gen_models.go b/internal/graphclient/gen_models.go index 8d37febda..39ec312dd 100644 --- a/internal/graphclient/gen_models.go +++ b/internal/graphclient/gen_models.go @@ -8,13 +8,11 @@ import ( "strconv" "time" - "go.infratographer.com/load-balancer-api/internal/ent/generated" - "go.infratographer.com/load-balancer-api/internal/ent/generated/pool" "go.infratographer.com/x/gidx" ) -type IPv4Addressable interface { - IsIPv4Addressable() +type IPAddressable interface { + IsIPAddressable() GetID() gidx.PrefixedID } @@ -55,11 +53,11 @@ type CreateLoadBalancerOriginInput struct { // CreateLoadBalancerPoolInput is used for create LoadBalancerPool object. // Input was generated by ent. type CreateLoadBalancerPoolInput struct { - Name string `json:"name"` - Protocol pool.Protocol `json:"protocol"` - OwnerID gidx.PrefixedID `json:"ownerID"` - PortIDs []gidx.PrefixedID `json:"portIDs,omitempty"` - OriginIDs []gidx.PrefixedID `json:"originIDs,omitempty"` + Name string `json:"name"` + Protocol LoadBalancerPoolProtocol `json:"protocol"` + OwnerID gidx.PrefixedID `json:"ownerID"` + PortIDs []gidx.PrefixedID `json:"portIDs,omitempty"` + OriginIDs []gidx.PrefixedID `json:"originIDs,omitempty"` } // CreateLoadBalancerPortInput is used for create LoadBalancerPort object. @@ -85,19 +83,17 @@ type LoadBalancer struct { CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` // The name of the load balancer. - Name string `json:"name"` - Annotations LoadBalancerAnnotationConnection `json:"annotations"` - Statuses LoadBalancerStatusConnection `json:"statuses"` - Ports LoadBalancerPortConnection `json:"ports"` + Name string `json:"name"` + Ports LoadBalancerPortConnection `json:"ports"` // The load balancer provider for the load balancer. - Provider generated.Provider `json:"loadBalancerProvider"` + LoadBalancerProvider LoadBalancerProvider `json:"loadBalancerProvider"` // The location of the load balancer. Location Location `json:"location"` // The owner of the load balancer. - Owner Owner `json:"owner"` + Owner ResourceOwner `json:"owner"` } -func (LoadBalancer) IsIPv4Addressable() {} +func (LoadBalancer) IsIPAddressable() {} func (this LoadBalancer) GetID() gidx.PrefixedID { return this.ID } func (LoadBalancer) IsNode() {} @@ -106,85 +102,6 @@ func (LoadBalancer) IsNode() {} func (LoadBalancer) IsEntity() {} -type LoadBalancerAnnotation struct { - ID gidx.PrefixedID `json:"id"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - LoadBalancerID gidx.PrefixedID `json:"loadBalancerID"` - LoadBalancer LoadBalancer `json:"loadBalancer"` -} - -func (LoadBalancerAnnotation) IsNode() {} - -// The id of the object. -func (this LoadBalancerAnnotation) GetID() gidx.PrefixedID { return this.ID } - -func (LoadBalancerAnnotation) IsEntity() {} - -// A connection to a list of items. -type LoadBalancerAnnotationConnection struct { - // A list of edges. - Edges []*LoadBalancerAnnotationEdge `json:"edges,omitempty"` - // Information to aid in pagination. - PageInfo PageInfo `json:"pageInfo"` - // Identifies the total count of items in the connection. - TotalCount int64 `json:"totalCount"` -} - -// An edge in a connection. -type LoadBalancerAnnotationEdge struct { - // The item at the end of the edge. - Node *LoadBalancerAnnotation `json:"node,omitempty"` - // A cursor for use in pagination. - Cursor string `json:"cursor"` -} - -// Ordering options for LoadBalancerAnnotation connections -type LoadBalancerAnnotationOrder struct { - // The ordering direction. - Direction OrderDirection `json:"direction"` - // The field by which to order LoadBalancerAnnotations. - Field LoadBalancerAnnotationOrderField `json:"field"` -} - -// LoadBalancerAnnotationWhereInput is used for filtering LoadBalancerAnnotation objects. -// Input was generated by ent. -type LoadBalancerAnnotationWhereInput struct { - Not *LoadBalancerAnnotationWhereInput `json:"not,omitempty"` - And []*LoadBalancerAnnotationWhereInput `json:"and,omitempty"` - Or []*LoadBalancerAnnotationWhereInput `json:"or,omitempty"` - // id field predicates - ID *gidx.PrefixedID `json:"id,omitempty"` - IDNeq *gidx.PrefixedID `json:"idNEQ,omitempty"` - IDIn []gidx.PrefixedID `json:"idIn,omitempty"` - IDNotIn []gidx.PrefixedID `json:"idNotIn,omitempty"` - IDGt *gidx.PrefixedID `json:"idGT,omitempty"` - IDGte *gidx.PrefixedID `json:"idGTE,omitempty"` - IDLt *gidx.PrefixedID `json:"idLT,omitempty"` - IDLte *gidx.PrefixedID `json:"idLTE,omitempty"` - // created_at field predicates - CreatedAt *time.Time `json:"createdAt,omitempty"` - CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` - CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` - CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` - CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` - CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` - CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` - CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` - // updated_at field predicates - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` - UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` - UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` - UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` - UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` - UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` - UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` - // load_balancer edge predicates - HasLoadBalancer *bool `json:"hasLoadBalancer,omitempty"` - HasLoadBalancerWith []*LoadBalancerWhereInput `json:"hasLoadBalancerWith,omitempty"` -} - // A connection to a list of items. type LoadBalancerConnection struct { // A list of edges. @@ -223,6 +140,25 @@ type LoadBalancerOrder struct { Field LoadBalancerOrderField `json:"field"` } +type LoadBalancerOrigin struct { + ID gidx.PrefixedID `json:"id"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + Name string `json:"name"` + Target string `json:"target"` + PortNumber int64 `json:"portNumber"` + Active bool `json:"active"` + PoolID gidx.PrefixedID `json:"poolID"` + Pool LoadBalancerPool `json:"pool"` +} + +func (LoadBalancerOrigin) IsNode() {} + +// The id of the object. +func (this LoadBalancerOrigin) GetID() gidx.PrefixedID { return this.ID } + +func (LoadBalancerOrigin) IsEntity() {} + // A connection to a list of items. type LoadBalancerOriginConnection struct { // A list of edges. @@ -236,7 +172,7 @@ type LoadBalancerOriginConnection struct { // Return response from loadBalancerOriginCreate type LoadBalancerOriginCreatePayload struct { // The created pool origin. - LoadBalancerOrigin generated.Origin `json:"loadBalancerOrigin"` + LoadBalancerOrigin LoadBalancerOrigin `json:"loadBalancerOrigin"` } // Return response from loadBalancerOriginDelete @@ -248,7 +184,7 @@ type LoadBalancerOriginDeletePayload struct { // An edge in a connection. type LoadBalancerOriginEdge struct { // The item at the end of the edge. - Node *generated.Origin `json:"node,omitempty"` + Node *LoadBalancerOrigin `json:"node,omitempty"` // A cursor for use in pagination. Cursor string `json:"cursor"` } @@ -264,7 +200,7 @@ type LoadBalancerOriginOrder struct { // Return response from loadBalancerOriginUpdate type LoadBalancerOriginUpdatePayload struct { // The updated pool origin. - LoadBalancerOrigin generated.Origin `json:"loadBalancerOrigin"` + LoadBalancerOrigin LoadBalancerOrigin `json:"loadBalancerOrigin"` } // LoadBalancerOriginWhereInput is used for filtering Origin objects. @@ -345,6 +281,26 @@ type LoadBalancerOriginWhereInput struct { HasPoolWith []*LoadBalancerPoolWhereInput `json:"hasPoolWith,omitempty"` } +type LoadBalancerPool struct { + ID gidx.PrefixedID `json:"id"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + Name string `json:"name"` + Protocol LoadBalancerPoolProtocol `json:"protocol"` + OwnerID gidx.PrefixedID `json:"ownerID"` + Ports []*LoadBalancerPort `json:"ports,omitempty"` + Origins LoadBalancerOriginConnection `json:"origins"` + // The owner of the load balancer pool. + Owner ResourceOwner `json:"owner"` +} + +func (LoadBalancerPool) IsNode() {} + +// The id of the object. +func (this LoadBalancerPool) GetID() gidx.PrefixedID { return this.ID } + +func (LoadBalancerPool) IsEntity() {} + // A connection to a list of items. type LoadBalancerPoolConnection struct { // A list of edges. @@ -358,7 +314,7 @@ type LoadBalancerPoolConnection struct { // Return response from LoadBalancerPoolCreate type LoadBalancerPoolCreatePayload struct { // The created pool. - LoadBalancerPool generated.Pool `json:"loadBalancerPool"` + LoadBalancerPool LoadBalancerPool `json:"loadBalancerPool"` } // Return response from LoadBalancerPoolDelete @@ -370,7 +326,7 @@ type LoadBalancerPoolDeletePayload struct { // An edge in a connection. type LoadBalancerPoolEdge struct { // The item at the end of the edge. - Node *generated.Pool `json:"node,omitempty"` + Node *LoadBalancerPool `json:"node,omitempty"` // A cursor for use in pagination. Cursor string `json:"cursor"` } @@ -386,7 +342,7 @@ type LoadBalancerPoolOrder struct { // Return response from LoadBalancerPoolUpdate type LoadBalancerPoolUpdatePayload struct { // The updated pool. - LoadBalancerPool generated.Pool `json:"loadBalancerPool"` + LoadBalancerPool LoadBalancerPool `json:"loadBalancerPool"` } // LoadBalancerPoolWhereInput is used for filtering Pool objects. @@ -437,10 +393,10 @@ type LoadBalancerPoolWhereInput struct { NameEqualFold *string `json:"nameEqualFold,omitempty"` NameContainsFold *string `json:"nameContainsFold,omitempty"` // protocol field predicates - Protocol *pool.Protocol `json:"protocol,omitempty"` - ProtocolNeq *pool.Protocol `json:"protocolNEQ,omitempty"` - ProtocolIn []pool.Protocol `json:"protocolIn,omitempty"` - ProtocolNotIn []pool.Protocol `json:"protocolNotIn,omitempty"` + Protocol *LoadBalancerPoolProtocol `json:"protocol,omitempty"` + ProtocolNeq *LoadBalancerPoolProtocol `json:"protocolNEQ,omitempty"` + ProtocolIn []LoadBalancerPoolProtocol `json:"protocolIn,omitempty"` + ProtocolNotIn []LoadBalancerPoolProtocol `json:"protocolNotIn,omitempty"` // ports edge predicates HasPorts *bool `json:"hasPorts,omitempty"` HasPortsWith []*LoadBalancerPortWhereInput `json:"hasPortsWith,omitempty"` @@ -449,6 +405,24 @@ type LoadBalancerPoolWhereInput struct { HasOriginsWith []*LoadBalancerOriginWhereInput `json:"hasOriginsWith,omitempty"` } +type LoadBalancerPort struct { + ID gidx.PrefixedID `json:"id"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + Number int64 `json:"number"` + Name string `json:"name"` + LoadBalancerID gidx.PrefixedID `json:"loadBalancerID"` + Pools []*LoadBalancerPool `json:"pools,omitempty"` + LoadBalancer LoadBalancer `json:"loadBalancer"` +} + +func (LoadBalancerPort) IsNode() {} + +// The id of the object. +func (this LoadBalancerPort) GetID() gidx.PrefixedID { return this.ID } + +func (LoadBalancerPort) IsEntity() {} + // A connection to a list of items. type LoadBalancerPortConnection struct { // A list of edges. @@ -462,7 +436,7 @@ type LoadBalancerPortConnection struct { // Return response from loadBalancerPortCreate type LoadBalancerPortCreatePayload struct { // The created load balancer port. - LoadBalancerPort generated.Port `json:"loadBalancerPort"` + LoadBalancerPort LoadBalancerPort `json:"loadBalancerPort"` } // Return response from loadBalancerPortDelete @@ -474,7 +448,7 @@ type LoadBalancerPortDeletePayload struct { // An edge in a connection. type LoadBalancerPortEdge struct { // The item at the end of the edge. - Node *generated.Port `json:"node,omitempty"` + Node *LoadBalancerPort `json:"node,omitempty"` // A cursor for use in pagination. Cursor string `json:"cursor"` } @@ -490,7 +464,7 @@ type LoadBalancerPortOrder struct { // Return response from loadBalancerPortUpdate type LoadBalancerPortUpdatePayload struct { // The updated load balancer port. - LoadBalancerPort generated.Port `json:"loadBalancerPort"` + LoadBalancerPort LoadBalancerPort `json:"loadBalancerPort"` } // LoadBalancerPortWhereInput is used for filtering Port objects. @@ -557,6 +531,25 @@ type LoadBalancerPortWhereInput struct { HasLoadBalancerWith []*LoadBalancerWhereInput `json:"hasLoadBalancerWith,omitempty"` } +type LoadBalancerProvider struct { + // The ID for the load balancer provider. + ID gidx.PrefixedID `json:"id"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + // The name of the load balancer provider. + Name string `json:"name"` + LoadBalancers LoadBalancerConnection `json:"loadBalancers"` + // The owner of the load balancer provider. + Owner ResourceOwner `json:"owner"` +} + +func (LoadBalancerProvider) IsNode() {} + +// The id of the object. +func (this LoadBalancerProvider) GetID() gidx.PrefixedID { return this.ID } + +func (LoadBalancerProvider) IsEntity() {} + // A connection to a list of items. type LoadBalancerProviderConnection struct { // A list of edges. @@ -570,7 +563,7 @@ type LoadBalancerProviderConnection struct { // Return response from loadBalancerProviderCreate type LoadBalancerProviderCreatePayload struct { // The created load balancer provider. - LoadBalancerProvider generated.Provider `json:"loadBalancerProvider"` + LoadBalancerProvider LoadBalancerProvider `json:"loadBalancerProvider"` } // Return response from loadBalancerProviderDelete @@ -582,7 +575,7 @@ type LoadBalancerProviderDeletePayload struct { // An edge in a connection. type LoadBalancerProviderEdge struct { // The item at the end of the edge. - Node *generated.Provider `json:"node,omitempty"` + Node *LoadBalancerProvider `json:"node,omitempty"` // A cursor for use in pagination. Cursor string `json:"cursor"` } @@ -598,7 +591,7 @@ type LoadBalancerProviderOrder struct { // Return response from loadBalancerProviderUpdate type LoadBalancerProviderUpdatePayload struct { // The updated load balancer provider. - LoadBalancerProvider generated.Provider `json:"loadBalancerProvider"` + LoadBalancerProvider LoadBalancerProvider `json:"loadBalancerProvider"` } // LoadBalancerProviderWhereInput is used for filtering Provider objects. @@ -653,100 +646,6 @@ type LoadBalancerProviderWhereInput struct { HasLoadBalancersWith []*LoadBalancerWhereInput `json:"hasLoadBalancersWith,omitempty"` } -type LoadBalancerStatus struct { - ID gidx.PrefixedID `json:"id"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - LoadBalancerID gidx.PrefixedID `json:"loadBalancerID"` - Source string `json:"source"` - LoadBalancer LoadBalancer `json:"loadBalancer"` -} - -func (LoadBalancerStatus) IsNode() {} - -// The id of the object. -func (this LoadBalancerStatus) GetID() gidx.PrefixedID { return this.ID } - -func (LoadBalancerStatus) IsEntity() {} - -// A connection to a list of items. -type LoadBalancerStatusConnection struct { - // A list of edges. - Edges []*LoadBalancerStatusEdge `json:"edges,omitempty"` - // Information to aid in pagination. - PageInfo PageInfo `json:"pageInfo"` - // Identifies the total count of items in the connection. - TotalCount int64 `json:"totalCount"` -} - -// An edge in a connection. -type LoadBalancerStatusEdge struct { - // The item at the end of the edge. - Node *LoadBalancerStatus `json:"node,omitempty"` - // A cursor for use in pagination. - Cursor string `json:"cursor"` -} - -// Ordering options for LoadBalancerStatus connections -type LoadBalancerStatusOrder struct { - // The ordering direction. - Direction OrderDirection `json:"direction"` - // The field by which to order LoadBalancerStatusSlice. - Field LoadBalancerStatusOrderField `json:"field"` -} - -// LoadBalancerStatusWhereInput is used for filtering LoadBalancerStatus objects. -// Input was generated by ent. -type LoadBalancerStatusWhereInput struct { - Not *LoadBalancerStatusWhereInput `json:"not,omitempty"` - And []*LoadBalancerStatusWhereInput `json:"and,omitempty"` - Or []*LoadBalancerStatusWhereInput `json:"or,omitempty"` - // id field predicates - ID *gidx.PrefixedID `json:"id,omitempty"` - IDNeq *gidx.PrefixedID `json:"idNEQ,omitempty"` - IDIn []gidx.PrefixedID `json:"idIn,omitempty"` - IDNotIn []gidx.PrefixedID `json:"idNotIn,omitempty"` - IDGt *gidx.PrefixedID `json:"idGT,omitempty"` - IDGte *gidx.PrefixedID `json:"idGTE,omitempty"` - IDLt *gidx.PrefixedID `json:"idLT,omitempty"` - IDLte *gidx.PrefixedID `json:"idLTE,omitempty"` - // created_at field predicates - CreatedAt *time.Time `json:"createdAt,omitempty"` - CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` - CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` - CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` - CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` - CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` - CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` - CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` - // updated_at field predicates - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` - UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` - UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` - UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` - UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` - UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` - UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` - // source field predicates - Source *string `json:"source,omitempty"` - SourceNeq *string `json:"sourceNEQ,omitempty"` - SourceIn []string `json:"sourceIn,omitempty"` - SourceNotIn []string `json:"sourceNotIn,omitempty"` - SourceGt *string `json:"sourceGT,omitempty"` - SourceGte *string `json:"sourceGTE,omitempty"` - SourceLt *string `json:"sourceLT,omitempty"` - SourceLte *string `json:"sourceLTE,omitempty"` - SourceContains *string `json:"sourceContains,omitempty"` - SourceHasPrefix *string `json:"sourceHasPrefix,omitempty"` - SourceHasSuffix *string `json:"sourceHasSuffix,omitempty"` - SourceEqualFold *string `json:"sourceEqualFold,omitempty"` - SourceContainsFold *string `json:"sourceContainsFold,omitempty"` - // load_balancer edge predicates - HasLoadBalancer *bool `json:"hasLoadBalancer,omitempty"` - HasLoadBalancerWith []*LoadBalancerWhereInput `json:"hasLoadBalancerWith,omitempty"` -} - // Return response from loadBalancerUpdate type LoadBalancerUpdatePayload struct { // The updated load balancer. @@ -800,12 +699,6 @@ type LoadBalancerWhereInput struct { NameHasSuffix *string `json:"nameHasSuffix,omitempty"` NameEqualFold *string `json:"nameEqualFold,omitempty"` NameContainsFold *string `json:"nameContainsFold,omitempty"` - // annotations edge predicates - HasAnnotations *bool `json:"hasAnnotations,omitempty"` - HasAnnotationsWith []*LoadBalancerAnnotationWhereInput `json:"hasAnnotationsWith,omitempty"` - // statuses edge predicates - HasStatuses *bool `json:"hasStatuses,omitempty"` - HasStatusesWith []*LoadBalancerStatusWhereInput `json:"hasStatusesWith,omitempty"` // ports edge predicates HasPorts *bool `json:"hasPorts,omitempty"` HasPortsWith []*LoadBalancerPortWhereInput `json:"hasPortsWith,omitempty"` @@ -821,15 +714,6 @@ type Location struct { func (Location) IsEntity() {} -type Owner struct { - ID gidx.PrefixedID `json:"id"` - LoadBalancers LoadBalancerConnection `json:"loadBalancers"` - LoadBalancerPools LoadBalancerPoolConnection `json:"loadBalancerPools"` - LoadBalancersProviders LoadBalancerProviderConnection `json:"loadBalancersProviders"` -} - -func (Owner) IsEntity() {} - // Information about pagination in a connection. // https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo type PageInfo struct { @@ -843,6 +727,15 @@ type PageInfo struct { EndCursor *string `json:"endCursor,omitempty"` } +type ResourceOwner struct { + ID gidx.PrefixedID `json:"id"` + LoadBalancers LoadBalancerConnection `json:"loadBalancers"` + LoadBalancerPools LoadBalancerPoolConnection `json:"loadBalancerPools"` + LoadBalancersProviders LoadBalancerProviderConnection `json:"loadBalancersProviders"` +} + +func (ResourceOwner) IsEntity() {} + // Input information to update a load balancer. type UpdateLoadBalancerInput struct { // The name of the load balancer. @@ -864,14 +757,14 @@ type UpdateLoadBalancerOriginInput struct { // UpdateLoadBalancerPoolInput is used for update LoadBalancerPool object. // Input was generated by ent. type UpdateLoadBalancerPoolInput struct { - Name *string `json:"name,omitempty"` - Protocol *pool.Protocol `json:"protocol,omitempty"` - AddPortIDs []gidx.PrefixedID `json:"addPortIDs,omitempty"` - RemovePortIDs []gidx.PrefixedID `json:"removePortIDs,omitempty"` - ClearPorts *bool `json:"clearPorts,omitempty"` - AddOriginIDs []gidx.PrefixedID `json:"addOriginIDs,omitempty"` - RemoveOriginIDs []gidx.PrefixedID `json:"removeOriginIDs,omitempty"` - ClearOrigins *bool `json:"clearOrigins,omitempty"` + Name *string `json:"name,omitempty"` + Protocol *LoadBalancerPoolProtocol `json:"protocol,omitempty"` + AddPortIDs []gidx.PrefixedID `json:"addPortIDs,omitempty"` + RemovePortIDs []gidx.PrefixedID `json:"removePortIDs,omitempty"` + ClearPorts *bool `json:"clearPorts,omitempty"` + AddOriginIDs []gidx.PrefixedID `json:"addOriginIDs,omitempty"` + RemoveOriginIDs []gidx.PrefixedID `json:"removeOriginIDs,omitempty"` + ClearOrigins *bool `json:"clearOrigins,omitempty"` } // UpdateLoadBalancerPortInput is used for update LoadBalancerPort object. @@ -894,48 +787,6 @@ type Service struct { Sdl *string `json:"sdl,omitempty"` } -// Properties by which LoadBalancerAnnotation connections can be ordered. -type LoadBalancerAnnotationOrderField string - -const ( - LoadBalancerAnnotationOrderFieldCreatedAt LoadBalancerAnnotationOrderField = "CREATED_AT" - LoadBalancerAnnotationOrderFieldUpdatedAt LoadBalancerAnnotationOrderField = "UPDATED_AT" -) - -var AllLoadBalancerAnnotationOrderField = []LoadBalancerAnnotationOrderField{ - LoadBalancerAnnotationOrderFieldCreatedAt, - LoadBalancerAnnotationOrderFieldUpdatedAt, -} - -func (e LoadBalancerAnnotationOrderField) IsValid() bool { - switch e { - case LoadBalancerAnnotationOrderFieldCreatedAt, LoadBalancerAnnotationOrderFieldUpdatedAt: - return true - } - return false -} - -func (e LoadBalancerAnnotationOrderField) String() string { - return string(e) -} - -func (e *LoadBalancerAnnotationOrderField) UnmarshalGQL(v interface{}) error { - str, ok := v.(string) - if !ok { - return fmt.Errorf("enums must be strings") - } - - *e = LoadBalancerAnnotationOrderField(str) - if !e.IsValid() { - return fmt.Errorf("%s is not a valid LoadBalancerAnnotationOrderField", str) - } - return nil -} - -func (e LoadBalancerAnnotationOrderField) MarshalGQL(w io.Writer) { - fmt.Fprint(w, strconv.Quote(e.String())) -} - // Properties by which LoadBalancer connections can be ordered. type LoadBalancerOrderField string @@ -1080,6 +931,48 @@ func (e LoadBalancerPoolOrderField) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +// LoadBalancerPoolProtocol is enum for the field protocol +type LoadBalancerPoolProtocol string + +const ( + LoadBalancerPoolProtocolTCP LoadBalancerPoolProtocol = "tcp" + LoadBalancerPoolProtocolUDP LoadBalancerPoolProtocol = "udp" +) + +var AllLoadBalancerPoolProtocol = []LoadBalancerPoolProtocol{ + LoadBalancerPoolProtocolTCP, + LoadBalancerPoolProtocolUDP, +} + +func (e LoadBalancerPoolProtocol) IsValid() bool { + switch e { + case LoadBalancerPoolProtocolTCP, LoadBalancerPoolProtocolUDP: + return true + } + return false +} + +func (e LoadBalancerPoolProtocol) String() string { + return string(e) +} + +func (e *LoadBalancerPoolProtocol) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = LoadBalancerPoolProtocol(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid LoadBalancerPoolProtocol", str) + } + return nil +} + +func (e LoadBalancerPoolProtocol) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + // Properties by which LoadBalancerPort connections can be ordered. type LoadBalancerPortOrderField string @@ -1174,48 +1067,6 @@ func (e LoadBalancerProviderOrderField) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } -// Properties by which LoadBalancerStatus connections can be ordered. -type LoadBalancerStatusOrderField string - -const ( - LoadBalancerStatusOrderFieldCreatedAt LoadBalancerStatusOrderField = "CREATED_AT" - LoadBalancerStatusOrderFieldUpdatedAt LoadBalancerStatusOrderField = "UPDATED_AT" -) - -var AllLoadBalancerStatusOrderField = []LoadBalancerStatusOrderField{ - LoadBalancerStatusOrderFieldCreatedAt, - LoadBalancerStatusOrderFieldUpdatedAt, -} - -func (e LoadBalancerStatusOrderField) IsValid() bool { - switch e { - case LoadBalancerStatusOrderFieldCreatedAt, LoadBalancerStatusOrderFieldUpdatedAt: - return true - } - return false -} - -func (e LoadBalancerStatusOrderField) String() string { - return string(e) -} - -func (e *LoadBalancerStatusOrderField) UnmarshalGQL(v interface{}) error { - str, ok := v.(string) - if !ok { - return fmt.Errorf("enums must be strings") - } - - *e = LoadBalancerStatusOrderField(str) - if !e.IsValid() { - return fmt.Errorf("%s is not a valid LoadBalancerStatusOrderField", str) - } - return nil -} - -func (e LoadBalancerStatusOrderField) MarshalGQL(w io.Writer) { - fmt.Fprint(w, strconv.Quote(e.String())) -} - // Possible directions in which to order a list of items when provided an `orderBy` argument. type OrderDirection string diff --git a/internal/graphclient/loadbalancer.graphql b/internal/graphclient/loadbalancer.graphql index 9088bddd9..bb30eb744 100644 --- a/internal/graphclient/loadbalancer.graphql +++ b/internal/graphclient/loadbalancer.graphql @@ -17,8 +17,8 @@ query GetLoadBalancer($id: ID!) { } query GetOwnerLoadBalancers($id: ID!, $orderBy: LoadBalancerOrder) { - _entities(representations: { __typename: "Owner", id: $id }) { - ... on Owner { + _entities(representations: { __typename: "ResourceOwner", id: $id }) { + ... on ResourceOwner { loadBalancers(orderBy: $orderBy) { edges { node { diff --git a/internal/graphclient/schema/schema.graphql b/internal/graphclient/schema/schema.graphql new file mode 100644 index 000000000..8557dc1c2 --- /dev/null +++ b/internal/graphclient/schema/schema.graphql @@ -0,0 +1,972 @@ +directive @composeDirective(name: String!) repeatable on SCHEMA +directive @extends on OBJECT | INTERFACE +directive @external on OBJECT | FIELD_DEFINITION +directive @inaccessible on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION +directive @interfaceObject on OBJECT +directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE +directive @link(import: [String!], url: String!) repeatable on SCHEMA +directive @override(from: String!) on FIELD_DEFINITION +directive @prefixedID(prefix: String!) on OBJECT +directive @provides(fields: FieldSet!) on FIELD_DEFINITION +directive @requires(fields: FieldSet!) on FIELD_DEFINITION +directive @shareable repeatable on FIELD_DEFINITION | OBJECT +directive @tag(name: String!) repeatable on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION +"""Input information to create a load balancer.""" +input CreateLoadBalancerInput { + """The name of the load balancer.""" + name: String! + """The ID for the owner for this load balancer.""" + ownerID: ID! + """The ID for the location of this load balancer.""" + locationID: ID! + portIDs: [ID!] + providerID: ID! +} +""" +CreateLoadBalancerOriginInput is used for create LoadBalancerOrigin object. +Input was generated by ent. +""" +input CreateLoadBalancerOriginInput { + name: String! + target: String! + portNumber: Int! + active: Boolean + poolID: ID! +} +""" +CreateLoadBalancerPoolInput is used for create LoadBalancerPool object. +Input was generated by ent. +""" +input CreateLoadBalancerPoolInput { + name: String! + protocol: LoadBalancerPoolProtocol! + ownerID: ID! + portIDs: [ID!] + originIDs: [ID!] +} +""" +CreateLoadBalancerPortInput is used for create LoadBalancerPort object. +Input was generated by ent. +""" +input CreateLoadBalancerPortInput { + number: Int! + name: String! + poolIDs: [ID!] + loadBalancerID: ID! +} +"""Input information to create a load balancer provider.""" +input CreateLoadBalancerProviderInput { + """The name of the load balancer provider.""" + name: String! + """The ID for the owner for this load balancer.""" + ownerID: ID! +} +""" +Define a Relay Cursor type: +https://relay.dev/graphql/connections.htm#sec-Cursor +""" +scalar Cursor +scalar FieldSet +interface IPAddressable { + id: ID! +} +"""A valid JSON string.""" +scalar JSON +type LoadBalancer implements Node & IPAddressable @key(fields: "id") @prefixedID(prefix: "loadbal") { + """The ID for the load balancer.""" + id: ID! + createdAt: Time! + updatedAt: Time! + """The name of the load balancer.""" + name: String! + ports( + """Returns the elements in the list that come after the specified cursor.""" + after: Cursor + + """Returns the first _n_ elements from the list.""" + first: Int + + """Returns the elements in the list that come before the specified cursor.""" + before: Cursor + + """Returns the last _n_ elements from the list.""" + last: Int + + """Ordering options for LoadBalancerPorts returned from the connection.""" + orderBy: LoadBalancerPortOrder + + """Filtering options for LoadBalancerPorts returned from the connection.""" + where: LoadBalancerPortWhereInput + ): LoadBalancerPortConnection! + """The load balancer provider for the load balancer.""" + loadBalancerProvider: LoadBalancerProvider! + """The location of the load balancer.""" + location: Location! + """The owner of the load balancer.""" + owner: ResourceOwner! +} +"""A connection to a list of items.""" +type LoadBalancerConnection { + """A list of edges.""" + edges: [LoadBalancerEdge] + """Information to aid in pagination.""" + pageInfo: PageInfo! + """Identifies the total count of items in the connection.""" + totalCount: Int! +} +"""Return response from loadBalancerCreate""" +type LoadBalancerCreatePayload { + """The created load balancer.""" + loadBalancer: LoadBalancer! +} +"""Return response from loadBalancerDelete""" +type LoadBalancerDeletePayload { + """The ID of the deleted load balancer.""" + deletedID: ID! +} +"""An edge in a connection.""" +type LoadBalancerEdge { + """The item at the end of the edge.""" + node: LoadBalancer + """A cursor for use in pagination.""" + cursor: Cursor! +} +"""Ordering options for LoadBalancer connections""" +input LoadBalancerOrder { + """The ordering direction.""" + direction: OrderDirection! = ASC + """The field by which to order LoadBalancers.""" + field: LoadBalancerOrderField! +} +"""Properties by which LoadBalancer connections can be ordered.""" +enum LoadBalancerOrderField { + ID + CREATED_AT + UPDATED_AT + NAME + OWNER +} +type LoadBalancerOrigin implements Node @key(fields: "id") @prefixedID(prefix: "loadogn") { + id: ID! + createdAt: Time! + updatedAt: Time! + name: String! + target: String! + portNumber: Int! + active: Boolean! + poolID: ID! + pool: LoadBalancerPool! +} +"""A connection to a list of items.""" +type LoadBalancerOriginConnection { + """A list of edges.""" + edges: [LoadBalancerOriginEdge] + """Information to aid in pagination.""" + pageInfo: PageInfo! + """Identifies the total count of items in the connection.""" + totalCount: Int! +} +"""Return response from loadBalancerOriginCreate""" +type LoadBalancerOriginCreatePayload { + """The created pool origin.""" + loadBalancerOrigin: LoadBalancerOrigin! +} +"""Return response from loadBalancerOriginDelete""" +type LoadBalancerOriginDeletePayload { + """The deleted pool origin.""" + deletedID: ID! +} +"""An edge in a connection.""" +type LoadBalancerOriginEdge { + """The item at the end of the edge.""" + node: LoadBalancerOrigin + """A cursor for use in pagination.""" + cursor: Cursor! +} +"""Ordering options for LoadBalancerOrigin connections""" +input LoadBalancerOriginOrder { + """The ordering direction.""" + direction: OrderDirection! = ASC + """The field by which to order LoadBalancerOrigins.""" + field: LoadBalancerOriginOrderField! +} +"""Properties by which LoadBalancerOrigin connections can be ordered.""" +enum LoadBalancerOriginOrderField { + CREATED_AT + UPDATED_AT + name + target + number + active +} +"""Return response from loadBalancerOriginUpdate""" +type LoadBalancerOriginUpdatePayload { + """The updated pool origin.""" + loadBalancerOrigin: LoadBalancerOrigin! +} +""" +LoadBalancerOriginWhereInput is used for filtering Origin objects. +Input was generated by ent. +""" +input LoadBalancerOriginWhereInput { + not: LoadBalancerOriginWhereInput + and: [LoadBalancerOriginWhereInput!] + or: [LoadBalancerOriginWhereInput!] + """id field predicates""" + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """created_at field predicates""" + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + """updated_at field predicates""" + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + """name field predicates""" + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """target field predicates""" + target: String + targetNEQ: String + targetIn: [String!] + targetNotIn: [String!] + targetGT: String + targetGTE: String + targetLT: String + targetLTE: String + targetContains: String + targetHasPrefix: String + targetHasSuffix: String + targetEqualFold: String + targetContainsFold: String + """port_number field predicates""" + portNumber: Int + portNumberNEQ: Int + portNumberIn: [Int!] + portNumberNotIn: [Int!] + portNumberGT: Int + portNumberGTE: Int + portNumberLT: Int + portNumberLTE: Int + """active field predicates""" + active: Boolean + activeNEQ: Boolean + """pool edge predicates""" + hasPool: Boolean + hasPoolWith: [LoadBalancerPoolWhereInput!] +} +type LoadBalancerPool implements Node @key(fields: "id") @prefixedID(prefix: "loadpol") { + id: ID! + createdAt: Time! + updatedAt: Time! + name: String! + protocol: LoadBalancerPoolProtocol! + ownerID: ID! + ports: [LoadBalancerPort!] + origins( + """Returns the elements in the list that come after the specified cursor.""" + after: Cursor + + """Returns the first _n_ elements from the list.""" + first: Int + + """Returns the elements in the list that come before the specified cursor.""" + before: Cursor + + """Returns the last _n_ elements from the list.""" + last: Int + + """Ordering options for LoadBalancerOrigins returned from the connection.""" + orderBy: LoadBalancerOriginOrder + + """Filtering options for LoadBalancerOrigins returned from the connection.""" + where: LoadBalancerOriginWhereInput + ): LoadBalancerOriginConnection! + """The owner of the load balancer pool.""" + owner: ResourceOwner! +} +"""A connection to a list of items.""" +type LoadBalancerPoolConnection { + """A list of edges.""" + edges: [LoadBalancerPoolEdge] + """Information to aid in pagination.""" + pageInfo: PageInfo! + """Identifies the total count of items in the connection.""" + totalCount: Int! +} +"""Return response from LoadBalancerPoolCreate""" +type LoadBalancerPoolCreatePayload { + """The created pool.""" + loadBalancerPool: LoadBalancerPool! +} +"""Return response from LoadBalancerPoolDelete""" +type LoadBalancerPoolDeletePayload { + """The ID of the deleted pool.""" + deletedID: ID +} +"""An edge in a connection.""" +type LoadBalancerPoolEdge { + """The item at the end of the edge.""" + node: LoadBalancerPool + """A cursor for use in pagination.""" + cursor: Cursor! +} +"""Ordering options for LoadBalancerPool connections""" +input LoadBalancerPoolOrder { + """The ordering direction.""" + direction: OrderDirection! = ASC + """The field by which to order LoadBalancerPools.""" + field: LoadBalancerPoolOrderField! +} +"""Properties by which LoadBalancerPool connections can be ordered.""" +enum LoadBalancerPoolOrderField { + CREATED_AT + UPDATED_AT + name + protocol +} +"""LoadBalancerPoolProtocol is enum for the field protocol""" +enum LoadBalancerPoolProtocol { + tcp + udp +} +"""Return response from LoadBalancerPoolUpdate""" +type LoadBalancerPoolUpdatePayload { + """The updated pool.""" + loadBalancerPool: LoadBalancerPool! +} +""" +LoadBalancerPoolWhereInput is used for filtering Pool objects. +Input was generated by ent. +""" +input LoadBalancerPoolWhereInput { + not: LoadBalancerPoolWhereInput + and: [LoadBalancerPoolWhereInput!] + or: [LoadBalancerPoolWhereInput!] + """id field predicates""" + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """created_at field predicates""" + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + """updated_at field predicates""" + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + """name field predicates""" + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """protocol field predicates""" + protocol: LoadBalancerPoolProtocol + protocolNEQ: LoadBalancerPoolProtocol + protocolIn: [LoadBalancerPoolProtocol!] + protocolNotIn: [LoadBalancerPoolProtocol!] + """ports edge predicates""" + hasPorts: Boolean + hasPortsWith: [LoadBalancerPortWhereInput!] + """origins edge predicates""" + hasOrigins: Boolean + hasOriginsWith: [LoadBalancerOriginWhereInput!] +} +type LoadBalancerPort implements Node @key(fields: "id") @prefixedID(prefix: "loadprt") { + id: ID! + createdAt: Time! + updatedAt: Time! + number: Int! + name: String! + loadBalancerID: ID! + pools: [LoadBalancerPool!] + loadBalancer: LoadBalancer! +} +"""A connection to a list of items.""" +type LoadBalancerPortConnection { + """A list of edges.""" + edges: [LoadBalancerPortEdge] + """Information to aid in pagination.""" + pageInfo: PageInfo! + """Identifies the total count of items in the connection.""" + totalCount: Int! +} +"""Return response from loadBalancerPortCreate""" +type LoadBalancerPortCreatePayload { + """The created load balancer port.""" + loadBalancerPort: LoadBalancerPort! +} +"""Return response from loadBalancerPortDelete""" +type LoadBalancerPortDeletePayload { + """The ID of the deleted load balancer port.""" + deletedID: ID! +} +"""An edge in a connection.""" +type LoadBalancerPortEdge { + """The item at the end of the edge.""" + node: LoadBalancerPort + """A cursor for use in pagination.""" + cursor: Cursor! +} +"""Ordering options for LoadBalancerPort connections""" +input LoadBalancerPortOrder { + """The ordering direction.""" + direction: OrderDirection! = ASC + """The field by which to order LoadBalancerPorts.""" + field: LoadBalancerPortOrderField! +} +"""Properties by which LoadBalancerPort connections can be ordered.""" +enum LoadBalancerPortOrderField { + CREATED_AT + UPDATED_AT + number + name +} +"""Return response from loadBalancerPortUpdate""" +type LoadBalancerPortUpdatePayload { + """The updated load balancer port.""" + loadBalancerPort: LoadBalancerPort! +} +""" +LoadBalancerPortWhereInput is used for filtering Port objects. +Input was generated by ent. +""" +input LoadBalancerPortWhereInput { + not: LoadBalancerPortWhereInput + and: [LoadBalancerPortWhereInput!] + or: [LoadBalancerPortWhereInput!] + """id field predicates""" + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """created_at field predicates""" + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + """updated_at field predicates""" + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + """number field predicates""" + number: Int + numberNEQ: Int + numberIn: [Int!] + numberNotIn: [Int!] + numberGT: Int + numberGTE: Int + numberLT: Int + numberLTE: Int + """name field predicates""" + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """pools edge predicates""" + hasPools: Boolean + hasPoolsWith: [LoadBalancerPoolWhereInput!] + """load_balancer edge predicates""" + hasLoadBalancer: Boolean + hasLoadBalancerWith: [LoadBalancerWhereInput!] +} +type LoadBalancerProvider implements Node @key(fields: "id") @prefixedID(prefix: "loadpvd") { + """The ID for the load balancer provider.""" + id: ID! + createdAt: Time! + updatedAt: Time! + """The name of the load balancer provider.""" + name: String! + loadBalancers( + """Returns the elements in the list that come after the specified cursor.""" + after: Cursor + + """Returns the first _n_ elements from the list.""" + first: Int + + """Returns the elements in the list that come before the specified cursor.""" + before: Cursor + + """Returns the last _n_ elements from the list.""" + last: Int + + """Ordering options for LoadBalancers returned from the connection.""" + orderBy: LoadBalancerOrder + + """Filtering options for LoadBalancers returned from the connection.""" + where: LoadBalancerWhereInput + ): LoadBalancerConnection! + """The owner of the load balancer provider.""" + owner: ResourceOwner! +} +"""A connection to a list of items.""" +type LoadBalancerProviderConnection { + """A list of edges.""" + edges: [LoadBalancerProviderEdge] + """Information to aid in pagination.""" + pageInfo: PageInfo! + """Identifies the total count of items in the connection.""" + totalCount: Int! +} +"""Return response from loadBalancerProviderCreate""" +type LoadBalancerProviderCreatePayload { + """The created load balancer provider.""" + loadBalancerProvider: LoadBalancerProvider! +} +"""Return response from loadBalancerProviderDelete""" +type LoadBalancerProviderDeletePayload { + """The ID of the deleted load balancer provider.""" + deletedID: ID! +} +"""An edge in a connection.""" +type LoadBalancerProviderEdge { + """The item at the end of the edge.""" + node: LoadBalancerProvider + """A cursor for use in pagination.""" + cursor: Cursor! +} +"""Ordering options for LoadBalancerProvider connections""" +input LoadBalancerProviderOrder { + """The ordering direction.""" + direction: OrderDirection! = ASC + """The field by which to order LoadBalancerProviders.""" + field: LoadBalancerProviderOrderField! +} +"""Properties by which LoadBalancerProvider connections can be ordered.""" +enum LoadBalancerProviderOrderField { + ID + CREATED_AT + UPDATED_AT + NAME + OWNER +} +"""Return response from loadBalancerProviderUpdate""" +type LoadBalancerProviderUpdatePayload { + """The updated load balancer provider.""" + loadBalancerProvider: LoadBalancerProvider! +} +""" +LoadBalancerProviderWhereInput is used for filtering Provider objects. +Input was generated by ent. +""" +input LoadBalancerProviderWhereInput { + not: LoadBalancerProviderWhereInput + and: [LoadBalancerProviderWhereInput!] + or: [LoadBalancerProviderWhereInput!] + """id field predicates""" + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """created_at field predicates""" + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + """updated_at field predicates""" + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + """name field predicates""" + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """load_balancers edge predicates""" + hasLoadBalancers: Boolean + hasLoadBalancersWith: [LoadBalancerWhereInput!] +} +"""Return response from loadBalancerUpdate""" +type LoadBalancerUpdatePayload { + """The updated load balancer.""" + loadBalancer: LoadBalancer! +} +""" +LoadBalancerWhereInput is used for filtering LoadBalancer objects. +Input was generated by ent. +""" +input LoadBalancerWhereInput { + not: LoadBalancerWhereInput + and: [LoadBalancerWhereInput!] + or: [LoadBalancerWhereInput!] + """id field predicates""" + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """created_at field predicates""" + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + """updated_at field predicates""" + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + """name field predicates""" + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ports edge predicates""" + hasPorts: Boolean + hasPortsWith: [LoadBalancerPortWhereInput!] + """provider edge predicates""" + hasProvider: Boolean + hasProviderWith: [LoadBalancerProviderWhereInput!] +} +type Location @key(fields: "id") { + id: ID! + loadBalancers( + """Returns the elements in the list that come after the specified cursor.""" + after: Cursor + + """Returns the first _n_ elements from the list.""" + first: Int + + """Returns the elements in the list that come before the specified cursor.""" + before: Cursor + + """Returns the last _n_ elements from the list.""" + last: Int + + """Ordering options for LoadBalancers returned from the connection.""" + orderBy: LoadBalancerOrder + + """Filtering options for LoadBalancers returned from the connection.""" + where: LoadBalancerWhereInput + ): LoadBalancerConnection! +} +type Mutation { + """Create a loadbalancer pool origin""" + loadBalancerOriginCreate(input: CreateLoadBalancerOriginInput!): LoadBalancerOriginCreatePayload! + """Update a loadbalancer pool origin""" + loadBalancerOriginUpdate(id: ID!, input: UpdateLoadBalancerOriginInput!): LoadBalancerOriginUpdatePayload! + """Delete a loadbalancer pool origin""" + loadBalancerOriginDelete(id: ID!): LoadBalancerOriginDeletePayload! + """Create a load balancer.""" + loadBalancerCreate(input: CreateLoadBalancerInput!): LoadBalancerCreatePayload! + """Update a load balancer.""" + loadBalancerUpdate(id: ID!, input: UpdateLoadBalancerInput!): LoadBalancerUpdatePayload! + """Delete a load balancer.""" + loadBalancerDelete(id: ID!): LoadBalancerDeletePayload! + """Create a pool.""" + loadBalancerPoolCreate(input: CreateLoadBalancerPoolInput!): LoadBalancerPoolCreatePayload! + """Update a pool.""" + loadBalancerPoolUpdate(id: ID!, input: UpdateLoadBalancerPoolInput!): LoadBalancerPoolUpdatePayload! + """Delete a pool.""" + loadBalancerPoolDelete(id: ID!): LoadBalancerPoolDeletePayload! + """Create a load balancer port.""" + loadBalancerPortCreate(input: CreateLoadBalancerPortInput!): LoadBalancerPortCreatePayload! + """Update a load balancer port.""" + loadBalancerPortUpdate(id: ID!, input: UpdateLoadBalancerPortInput!): LoadBalancerPortUpdatePayload! + """Delete a load balancer port""" + loadBalancerPortDelete(id: ID!): LoadBalancerPortDeletePayload! + """Create a load balancer provider.""" + loadBalancerProviderCreate(input: CreateLoadBalancerProviderInput!): LoadBalancerProviderCreatePayload! + """Update a load balancer provider.""" + loadBalancerProviderUpdate(id: ID!, input: UpdateLoadBalancerProviderInput!): LoadBalancerProviderUpdatePayload! + """Delete a load balancer provider.""" + loadBalancerProviderDelete(id: ID!): LoadBalancerProviderDeletePayload! +} +""" +An object with an ID. +Follows the [Relay Global Object Identification Specification](https://relay.dev/graphql/objectidentification.htm) +""" +interface Node { + """The id of the object.""" + id: ID! +} +"""Possible directions in which to order a list of items when provided an `orderBy` argument.""" +enum OrderDirection { + """Specifies an ascending order for a given `orderBy` argument.""" + ASC + """Specifies a descending order for a given `orderBy` argument.""" + DESC +} +""" +Information about pagination in a connection. +https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo +""" +type PageInfo @shareable { + """When paginating forwards, are there more items?""" + hasNextPage: Boolean! + """When paginating backwards, are there more items?""" + hasPreviousPage: Boolean! + """When paginating backwards, the cursor to continue.""" + startCursor: Cursor + """When paginating forwards, the cursor to continue.""" + endCursor: Cursor +} +type Query { + loadBalancerPools( + """Returns the elements in the list that come after the specified cursor.""" + after: Cursor + + """Returns the first _n_ elements from the list.""" + first: Int + + """Returns the elements in the list that come before the specified cursor.""" + before: Cursor + + """Returns the last _n_ elements from the list.""" + last: Int + + """Ordering options for LoadBalancerPools returned from the connection.""" + orderBy: LoadBalancerPoolOrder + + """Filtering options for LoadBalancerPools returned from the connection.""" + where: LoadBalancerPoolWhereInput + ): LoadBalancerPoolConnection! + """Lookup a load balancer by ID.""" + loadBalancer( + """The load balancer ID.""" + id: ID! + ): LoadBalancer! + """Lookup a pool by ID.""" + loadBalancerPool( + """The pool ID.""" + id: ID! + ): LoadBalancerPool! + """Lookup a load balancer provider by ID.""" + loadBalancerProvider( + """The load balancer provider ID.""" + id: ID! + ): LoadBalancerProvider! + _entities(representations: [_Any!]!): [_Entity]! + _service: _Service! +} +type ResourceOwner @interfaceObject @key(fields: "id") { + id: ID! + loadBalancers( + """Returns the elements in the list that come after the specified cursor.""" + after: Cursor + + """Returns the first _n_ elements from the list.""" + first: Int + + """Returns the elements in the list that come before the specified cursor.""" + before: Cursor + + """Returns the last _n_ elements from the list.""" + last: Int + + """Ordering options for LoadBalancers returned from the connection.""" + orderBy: LoadBalancerOrder + + """Filtering options for LoadBalancers returned from the connection.""" + where: LoadBalancerWhereInput + ): LoadBalancerConnection! + loadBalancerPools( + """Returns the elements in the list that come after the specified cursor.""" + after: Cursor + + """Returns the first _n_ elements from the list.""" + first: Int + + """Returns the elements in the list that come before the specified cursor.""" + before: Cursor + + """Returns the last _n_ elements from the list.""" + last: Int + + """Ordering options for LoadBalancerPools returned from the connection.""" + orderBy: LoadBalancerPoolOrder + + """Filtering options for LoadBalancerPools returned from the connection.""" + where: LoadBalancerPoolWhereInput + ): LoadBalancerPoolConnection! + loadBalancersProviders( + """Returns the elements in the list that come after the specified cursor.""" + after: Cursor + + """Returns the first _n_ elements from the list.""" + first: Int + + """Returns the elements in the list that come before the specified cursor.""" + before: Cursor + + """Returns the last _n_ elements from the list.""" + last: Int + + """Ordering options for LoadBalancerProviders returned from the connection.""" + orderBy: LoadBalancerOrder + + """Filtering options for LoadBalancerProviders returned from the connection.""" + where: LoadBalancerProviderWhereInput + ): LoadBalancerProviderConnection! +} +"""The builtin Time type""" +scalar Time +"""Input information to update a load balancer.""" +input UpdateLoadBalancerInput { + """The name of the load balancer.""" + name: String + addPortIDs: [ID!] + removePortIDs: [ID!] + clearPorts: Boolean +} +""" +UpdateLoadBalancerOriginInput is used for update LoadBalancerOrigin object. +Input was generated by ent. +""" +input UpdateLoadBalancerOriginInput { + name: String + target: String + portNumber: Int + active: Boolean +} +""" +UpdateLoadBalancerPoolInput is used for update LoadBalancerPool object. +Input was generated by ent. +""" +input UpdateLoadBalancerPoolInput { + name: String + protocol: LoadBalancerPoolProtocol + addPortIDs: [ID!] + removePortIDs: [ID!] + clearPorts: Boolean + addOriginIDs: [ID!] + removeOriginIDs: [ID!] + clearOrigins: Boolean +} +""" +UpdateLoadBalancerPortInput is used for update LoadBalancerPort object. +Input was generated by ent. +""" +input UpdateLoadBalancerPortInput { + number: Int + name: String + addPoolIDs: [ID!] + removePoolIDs: [ID!] + clearPools: Boolean +} +"""Input information to update a load balancer provider.""" +input UpdateLoadBalancerProviderInput { + """The name of the load balancer provider.""" + name: String +} +scalar _Any +# a union of all types that use the @key directive +union _Entity = LoadBalancer | LoadBalancerOrigin | LoadBalancerPool | LoadBalancerPort | LoadBalancerProvider | Location | ResourceOwner +type _Service { + sdl: String +} diff --git a/schema.graphql b/schema.graphql index 188a17ebc..07b025846 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1,5 +1,4 @@ -directive @goField(forceResolver: Boolean, name: String) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION -directive @goModel(model: String, models: [String!]) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION +directive @prefixedID(prefix: String!) on OBJECT """Input information to create a load balancer.""" input CreateLoadBalancerInput { """The name of the load balancer.""" @@ -55,56 +54,18 @@ Define a Relay Cursor type: https://relay.dev/graphql/connections.htm#sec-Cursor """ scalar Cursor -interface IPv4Addressable { +interface IPAddressable { id: ID! } """A valid JSON string.""" scalar JSON -type LoadBalancer implements Node & IPv4Addressable @key(fields: "id") { +type LoadBalancer implements Node & IPAddressable @key(fields: "id") @prefixedID(prefix: "loadbal") { """The ID for the load balancer.""" id: ID! createdAt: Time! updatedAt: Time! """The name of the load balancer.""" name: String! - annotations( - """Returns the elements in the list that come after the specified cursor.""" - after: Cursor - - """Returns the first _n_ elements from the list.""" - first: Int - - """Returns the elements in the list that come before the specified cursor.""" - before: Cursor - - """Returns the last _n_ elements from the list.""" - last: Int - - """Ordering options for LoadBalancerAnnotations returned from the connection.""" - orderBy: LoadBalancerAnnotationOrder - - """Filtering options for LoadBalancerAnnotations returned from the connection.""" - where: LoadBalancerAnnotationWhereInput - ): LoadBalancerAnnotationConnection! - statuses( - """Returns the elements in the list that come after the specified cursor.""" - after: Cursor - - """Returns the first _n_ elements from the list.""" - first: Int - - """Returns the elements in the list that come before the specified cursor.""" - before: Cursor - - """Returns the last _n_ elements from the list.""" - last: Int - - """Ordering options for LoadBalancerStatusSlice returned from the connection.""" - orderBy: LoadBalancerStatusOrder - - """Filtering options for LoadBalancerStatusSlice returned from the connection.""" - where: LoadBalancerStatusWhereInput - ): LoadBalancerStatusConnection! ports( """Returns the elements in the list that come after the specified cursor.""" after: Cursor @@ -125,85 +86,11 @@ type LoadBalancer implements Node & IPv4Addressable @key(fields: "id") { where: LoadBalancerPortWhereInput ): LoadBalancerPortConnection! """The load balancer provider for the load balancer.""" - loadBalancerProvider: LoadBalancerProvider! @goField(name: "Provider", forceResolver: false) + loadBalancerProvider: LoadBalancerProvider! """The location of the load balancer.""" - location: Location! @goField(forceResolver: true) + location: Location! """The owner of the load balancer.""" - owner: Owner! @goField(forceResolver: true) -} -type LoadBalancerAnnotation implements Node @key(fields: "id") { - id: ID! - createdAt: Time! - updatedAt: Time! - loadBalancerID: ID! - loadBalancer: LoadBalancer! -} -"""A connection to a list of items.""" -type LoadBalancerAnnotationConnection { - """A list of edges.""" - edges: [LoadBalancerAnnotationEdge] - """Information to aid in pagination.""" - pageInfo: PageInfo! - """Identifies the total count of items in the connection.""" - totalCount: Int! -} -"""An edge in a connection.""" -type LoadBalancerAnnotationEdge { - """The item at the end of the edge.""" - node: LoadBalancerAnnotation - """A cursor for use in pagination.""" - cursor: Cursor! -} -"""Ordering options for LoadBalancerAnnotation connections""" -input LoadBalancerAnnotationOrder { - """The ordering direction.""" - direction: OrderDirection! = ASC - """The field by which to order LoadBalancerAnnotations.""" - field: LoadBalancerAnnotationOrderField! -} -"""Properties by which LoadBalancerAnnotation connections can be ordered.""" -enum LoadBalancerAnnotationOrderField { - CREATED_AT - UPDATED_AT -} -""" -LoadBalancerAnnotationWhereInput is used for filtering LoadBalancerAnnotation objects. -Input was generated by ent. -""" -input LoadBalancerAnnotationWhereInput { - not: LoadBalancerAnnotationWhereInput - and: [LoadBalancerAnnotationWhereInput!] - or: [LoadBalancerAnnotationWhereInput!] - """id field predicates""" - id: ID - idNEQ: ID - idIn: [ID!] - idNotIn: [ID!] - idGT: ID - idGTE: ID - idLT: ID - idLTE: ID - """created_at field predicates""" - createdAt: Time - createdAtNEQ: Time - createdAtIn: [Time!] - createdAtNotIn: [Time!] - createdAtGT: Time - createdAtGTE: Time - createdAtLT: Time - createdAtLTE: Time - """updated_at field predicates""" - updatedAt: Time - updatedAtNEQ: Time - updatedAtIn: [Time!] - updatedAtNotIn: [Time!] - updatedAtGT: Time - updatedAtGTE: Time - updatedAtLT: Time - updatedAtLTE: Time - """load_balancer edge predicates""" - hasLoadBalancer: Boolean - hasLoadBalancerWith: [LoadBalancerWhereInput!] + owner: ResourceOwner! } """A connection to a list of items.""" type LoadBalancerConnection { @@ -246,7 +133,7 @@ enum LoadBalancerOrderField { NAME OWNER } -type LoadBalancerOrigin implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Origin") { +type LoadBalancerOrigin implements Node @key(fields: "id") @prefixedID(prefix: "loadogn") { id: ID! createdAt: Time! updatedAt: Time! @@ -383,7 +270,7 @@ input LoadBalancerOriginWhereInput { hasPool: Boolean hasPoolWith: [LoadBalancerPoolWhereInput!] } -type LoadBalancerPool implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Pool") { +type LoadBalancerPool implements Node @key(fields: "id") @prefixedID(prefix: "loadpol") { id: ID! createdAt: Time! updatedAt: Time! @@ -411,7 +298,7 @@ type LoadBalancerPool implements Node @key(fields: "id") @goModel(model: "go.inf where: LoadBalancerOriginWhereInput ): LoadBalancerOriginConnection! """The owner of the load balancer pool.""" - owner: Owner! @goField(forceResolver: true) + owner: ResourceOwner! } """A connection to a list of items.""" type LoadBalancerPoolConnection { @@ -454,7 +341,7 @@ enum LoadBalancerPoolOrderField { protocol } """LoadBalancerPoolProtocol is enum for the field protocol""" -enum LoadBalancerPoolProtocol @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated/pool.Protocol") { +enum LoadBalancerPoolProtocol { tcp udp } @@ -524,7 +411,7 @@ input LoadBalancerPoolWhereInput { hasOrigins: Boolean hasOriginsWith: [LoadBalancerOriginWhereInput!] } -type LoadBalancerPort implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Port") { +type LoadBalancerPort implements Node @key(fields: "id") @prefixedID(prefix: "loadprt") { id: ID! createdAt: Time! updatedAt: Time! @@ -644,7 +531,7 @@ input LoadBalancerPortWhereInput { hasLoadBalancer: Boolean hasLoadBalancerWith: [LoadBalancerWhereInput!] } -type LoadBalancerProvider implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Provider") { +type LoadBalancerProvider implements Node @key(fields: "id") @prefixedID(prefix: "loadpvd") { """The ID for the load balancer provider.""" id: ID! createdAt: Time! @@ -671,7 +558,7 @@ type LoadBalancerProvider implements Node @key(fields: "id") @goModel(model: "go where: LoadBalancerWhereInput ): LoadBalancerConnection! """The owner of the load balancer provider.""" - owner: Owner! @goField(forceResolver: true) + owner: ResourceOwner! } """A connection to a list of items.""" type LoadBalancerProviderConnection { @@ -772,95 +659,6 @@ input LoadBalancerProviderWhereInput { hasLoadBalancers: Boolean hasLoadBalancersWith: [LoadBalancerWhereInput!] } -type LoadBalancerStatus implements Node @key(fields: "id") { - id: ID! - createdAt: Time! - updatedAt: Time! - loadBalancerID: ID! - source: String! - loadBalancer: LoadBalancer! -} -"""A connection to a list of items.""" -type LoadBalancerStatusConnection { - """A list of edges.""" - edges: [LoadBalancerStatusEdge] - """Information to aid in pagination.""" - pageInfo: PageInfo! - """Identifies the total count of items in the connection.""" - totalCount: Int! -} -"""An edge in a connection.""" -type LoadBalancerStatusEdge { - """The item at the end of the edge.""" - node: LoadBalancerStatus - """A cursor for use in pagination.""" - cursor: Cursor! -} -"""Ordering options for LoadBalancerStatus connections""" -input LoadBalancerStatusOrder { - """The ordering direction.""" - direction: OrderDirection! = ASC - """The field by which to order LoadBalancerStatusSlice.""" - field: LoadBalancerStatusOrderField! -} -"""Properties by which LoadBalancerStatus connections can be ordered.""" -enum LoadBalancerStatusOrderField { - CREATED_AT - UPDATED_AT -} -""" -LoadBalancerStatusWhereInput is used for filtering LoadBalancerStatus objects. -Input was generated by ent. -""" -input LoadBalancerStatusWhereInput { - not: LoadBalancerStatusWhereInput - and: [LoadBalancerStatusWhereInput!] - or: [LoadBalancerStatusWhereInput!] - """id field predicates""" - id: ID - idNEQ: ID - idIn: [ID!] - idNotIn: [ID!] - idGT: ID - idGTE: ID - idLT: ID - idLTE: ID - """created_at field predicates""" - createdAt: Time - createdAtNEQ: Time - createdAtIn: [Time!] - createdAtNotIn: [Time!] - createdAtGT: Time - createdAtGTE: Time - createdAtLT: Time - createdAtLTE: Time - """updated_at field predicates""" - updatedAt: Time - updatedAtNEQ: Time - updatedAtIn: [Time!] - updatedAtNotIn: [Time!] - updatedAtGT: Time - updatedAtGTE: Time - updatedAtLT: Time - updatedAtLTE: Time - """source field predicates""" - source: String - sourceNEQ: String - sourceIn: [String!] - sourceNotIn: [String!] - sourceGT: String - sourceGTE: String - sourceLT: String - sourceLTE: String - sourceContains: String - sourceHasPrefix: String - sourceHasSuffix: String - sourceEqualFold: String - sourceContainsFold: String - """load_balancer edge predicates""" - hasLoadBalancer: Boolean - hasLoadBalancerWith: [LoadBalancerWhereInput!] -} """Return response from loadBalancerUpdate""" type LoadBalancerUpdatePayload { """The updated load balancer.""" @@ -915,12 +713,6 @@ input LoadBalancerWhereInput { nameHasSuffix: String nameEqualFold: String nameContainsFold: String - """annotations edge predicates""" - hasAnnotations: Boolean - hasAnnotationsWith: [LoadBalancerAnnotationWhereInput!] - """statuses edge predicates""" - hasStatuses: Boolean - hasStatusesWith: [LoadBalancerStatusWhereInput!] """ports edge predicates""" hasPorts: Boolean hasPortsWith: [LoadBalancerPortWhereInput!] @@ -929,7 +721,7 @@ input LoadBalancerWhereInput { hasProviderWith: [LoadBalancerProviderWhereInput!] } type Location @key(fields: "id") { - id: ID! @external + id: ID! loadBalancers( """Returns the elements in the list that come after the specified cursor.""" after: Cursor @@ -948,21 +740,21 @@ type Location @key(fields: "id") { """Filtering options for LoadBalancers returned from the connection.""" where: LoadBalancerWhereInput - ): LoadBalancerConnection! @goField(forceResolver: true) + ): LoadBalancerConnection! } type Mutation { - """Create a load balancer.""" - loadBalancerCreate(input: CreateLoadBalancerInput!): LoadBalancerCreatePayload! - """Update a load balancer.""" - loadBalancerUpdate(id: ID!, input: UpdateLoadBalancerInput!): LoadBalancerUpdatePayload! - """Delete a load balancer.""" - loadBalancerDelete(id: ID!): LoadBalancerDeletePayload! """Create a loadbalancer pool origin""" loadBalancerOriginCreate(input: CreateLoadBalancerOriginInput!): LoadBalancerOriginCreatePayload! """Update a loadbalancer pool origin""" loadBalancerOriginUpdate(id: ID!, input: UpdateLoadBalancerOriginInput!): LoadBalancerOriginUpdatePayload! """Delete a loadbalancer pool origin""" loadBalancerOriginDelete(id: ID!): LoadBalancerOriginDeletePayload! + """Create a load balancer.""" + loadBalancerCreate(input: CreateLoadBalancerInput!): LoadBalancerCreatePayload! + """Update a load balancer.""" + loadBalancerUpdate(id: ID!, input: UpdateLoadBalancerInput!): LoadBalancerUpdatePayload! + """Delete a load balancer.""" + loadBalancerDelete(id: ID!): LoadBalancerDeletePayload! """Create a pool.""" loadBalancerPoolCreate(input: CreateLoadBalancerPoolInput!): LoadBalancerPoolCreatePayload! """Update a pool.""" @@ -997,8 +789,60 @@ enum OrderDirection { """Specifies a descending order for a given `orderBy` argument.""" DESC } -type Owner @key(fields: "id") { - id: ID! @external +""" +Information about pagination in a connection. +https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo +""" +type PageInfo @shareable { + """When paginating forwards, are there more items?""" + hasNextPage: Boolean! + """When paginating backwards, are there more items?""" + hasPreviousPage: Boolean! + """When paginating backwards, the cursor to continue.""" + startCursor: Cursor + """When paginating forwards, the cursor to continue.""" + endCursor: Cursor +} +type Query { + loadBalancerPools( + """Returns the elements in the list that come after the specified cursor.""" + after: Cursor + + """Returns the first _n_ elements from the list.""" + first: Int + + """Returns the elements in the list that come before the specified cursor.""" + before: Cursor + + """Returns the last _n_ elements from the list.""" + last: Int + + """Ordering options for LoadBalancerPools returned from the connection.""" + orderBy: LoadBalancerPoolOrder + + """Filtering options for LoadBalancerPools returned from the connection.""" + where: LoadBalancerPoolWhereInput + ): LoadBalancerPoolConnection! + """Lookup a load balancer by ID.""" + loadBalancer( + """The load balancer ID.""" + id: ID! + ): LoadBalancer! + """Lookup a pool by ID.""" + loadBalancerPool( + """The pool ID.""" + id: ID! + ): LoadBalancerPool! + """Lookup a load balancer provider by ID.""" + loadBalancerProvider( + """The load balancer provider ID.""" + id: ID! + ): LoadBalancerProvider! + _entities(representations: [_Any!]!): [_Entity]! + _service: _Service! +} +type ResourceOwner @interfaceObject @key(fields: "id") { + id: ID! loadBalancers( """Returns the elements in the list that come after the specified cursor.""" after: Cursor @@ -1017,7 +861,7 @@ type Owner @key(fields: "id") { """Filtering options for LoadBalancers returned from the connection.""" where: LoadBalancerWhereInput - ): LoadBalancerConnection! @goField(forceResolver: true) + ): LoadBalancerConnection! loadBalancerPools( """Returns the elements in the list that come after the specified cursor.""" after: Cursor @@ -1036,7 +880,7 @@ type Owner @key(fields: "id") { """Filtering options for LoadBalancerPools returned from the connection.""" where: LoadBalancerPoolWhereInput - ): LoadBalancerPoolConnection! @goField(forceResolver: true) + ): LoadBalancerPoolConnection! loadBalancersProviders( """Returns the elements in the list that come after the specified cursor.""" after: Cursor @@ -1055,59 +899,7 @@ type Owner @key(fields: "id") { """Filtering options for LoadBalancerProviders returned from the connection.""" where: LoadBalancerProviderWhereInput - ): LoadBalancerProviderConnection! @goField(forceResolver: true) -} -""" -Information about pagination in a connection. -https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo -""" -type PageInfo @shareable { - """When paginating forwards, are there more items?""" - hasNextPage: Boolean! - """When paginating backwards, are there more items?""" - hasPreviousPage: Boolean! - """When paginating backwards, the cursor to continue.""" - startCursor: Cursor - """When paginating forwards, the cursor to continue.""" - endCursor: Cursor -} -type Query { - loadBalancerPools( - """Returns the elements in the list that come after the specified cursor.""" - after: Cursor - - """Returns the first _n_ elements from the list.""" - first: Int - - """Returns the elements in the list that come before the specified cursor.""" - before: Cursor - - """Returns the last _n_ elements from the list.""" - last: Int - - """Ordering options for LoadBalancerPools returned from the connection.""" - orderBy: LoadBalancerPoolOrder - - """Filtering options for LoadBalancerPools returned from the connection.""" - where: LoadBalancerPoolWhereInput - ): LoadBalancerPoolConnection! - """Lookup a load balancer by ID.""" - loadBalancer( - """The load balancer ID.""" - id: ID! - ): LoadBalancer! - """Lookup a pool by ID.""" - loadBalancerPool( - """The pool ID.""" - id: ID! - ): LoadBalancerPool! - """Lookup a load balancer provider by ID.""" - loadBalancerProvider( - """The load balancer provider ID.""" - id: ID! - ): LoadBalancerProvider! - _entities(representations: [_Any!]!): [_Entity]! - _service: _Service! + ): LoadBalancerProviderConnection! } """The builtin Time type""" scalar Time @@ -1159,33 +951,24 @@ input UpdateLoadBalancerProviderInput { """The name of the load balancer provider.""" name: String } -union _Entity = LoadBalancer | LoadBalancerAnnotation | LoadBalancerOrigin | LoadBalancerPool | LoadBalancerPort | LoadBalancerProvider | LoadBalancerStatus | Location | Owner +scalar _Any +# a union of all types that use the @key directive +union _Entity = LoadBalancer | LoadBalancerOrigin | LoadBalancerPool | LoadBalancerPort | LoadBalancerProvider | Location | ResourceOwner type _Service { sdl: String } -scalar _Any -scalar FieldSet -directive @requires(fields: FieldSet!) on FIELD_DEFINITION -directive @provides(fields: FieldSet!) on FIELD_DEFINITION -directive @extends on OBJECT | INTERFACE -directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE -directive @link(import: [String!], url: String!) repeatable on SCHEMA -directive @external on FIELD_DEFINITION | OBJECT -directive @shareable on OBJECT | FIELD_DEFINITION -directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION -directive @override(from: String!) on FIELD_DEFINITION -directive @inaccessible on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION -#directive @interfaceObject on OBJECT + extend schema @link( - url: "https://specs.apollo.dev/federation/v2.3" - import: [ - "@key", - "@external", - "@shareable", - "@tag", - "@override", - "@inaccessible", - "@interfaceObject" - ] + url: "https://specs.apollo.dev/federation/v2.3" + import: [ + "@key", + "@interfaceObject", + "@shareable", + "@inaccessible", + "@override", + "@provides", + "@requires", + "@tag" + ] ) diff --git a/schema/ent.graphql b/schema/ent.graphql index 3f9c158d7..0e5a800e2 100644 --- a/schema/ent.graphql +++ b/schema/ent.graphql @@ -57,51 +57,13 @@ https://relay.dev/graphql/connections.htm#sec-Cursor scalar Cursor """A valid JSON string.""" scalar JSON -type LoadBalancer implements Node & IPv4Addressable @key(fields: "id") { +type LoadBalancer implements Node & IPAddressable @key(fields: "id") @prefixedID(prefix: "loadbal") { """The ID for the load balancer.""" id: ID! createdAt: Time! updatedAt: Time! """The name of the load balancer.""" name: String! - annotations( - """Returns the elements in the list that come after the specified cursor.""" - after: Cursor - - """Returns the first _n_ elements from the list.""" - first: Int - - """Returns the elements in the list that come before the specified cursor.""" - before: Cursor - - """Returns the last _n_ elements from the list.""" - last: Int - - """Ordering options for LoadBalancerAnnotations returned from the connection.""" - orderBy: LoadBalancerAnnotationOrder - - """Filtering options for LoadBalancerAnnotations returned from the connection.""" - where: LoadBalancerAnnotationWhereInput - ): LoadBalancerAnnotationConnection! - statuses( - """Returns the elements in the list that come after the specified cursor.""" - after: Cursor - - """Returns the first _n_ elements from the list.""" - first: Int - - """Returns the elements in the list that come before the specified cursor.""" - before: Cursor - - """Returns the last _n_ elements from the list.""" - last: Int - - """Ordering options for LoadBalancerStatusSlice returned from the connection.""" - orderBy: LoadBalancerStatusOrder - - """Filtering options for LoadBalancerStatusSlice returned from the connection.""" - where: LoadBalancerStatusWhereInput - ): LoadBalancerStatusConnection! ports( """Returns the elements in the list that come after the specified cursor.""" after: Cursor @@ -124,80 +86,6 @@ type LoadBalancer implements Node & IPv4Addressable @key(fields: "id") { """The load balancer provider for the load balancer.""" loadBalancerProvider: LoadBalancerProvider! @goField(name: "Provider", forceResolver: false) } -type LoadBalancerAnnotation implements Node @key(fields: "id") { - id: ID! - createdAt: Time! - updatedAt: Time! - loadBalancerID: ID! - loadBalancer: LoadBalancer! -} -"""A connection to a list of items.""" -type LoadBalancerAnnotationConnection { - """A list of edges.""" - edges: [LoadBalancerAnnotationEdge] - """Information to aid in pagination.""" - pageInfo: PageInfo! - """Identifies the total count of items in the connection.""" - totalCount: Int! -} -"""An edge in a connection.""" -type LoadBalancerAnnotationEdge { - """The item at the end of the edge.""" - node: LoadBalancerAnnotation - """A cursor for use in pagination.""" - cursor: Cursor! -} -"""Ordering options for LoadBalancerAnnotation connections""" -input LoadBalancerAnnotationOrder { - """The ordering direction.""" - direction: OrderDirection! = ASC - """The field by which to order LoadBalancerAnnotations.""" - field: LoadBalancerAnnotationOrderField! -} -"""Properties by which LoadBalancerAnnotation connections can be ordered.""" -enum LoadBalancerAnnotationOrderField { - CREATED_AT - UPDATED_AT -} -""" -LoadBalancerAnnotationWhereInput is used for filtering LoadBalancerAnnotation objects. -Input was generated by ent. -""" -input LoadBalancerAnnotationWhereInput { - not: LoadBalancerAnnotationWhereInput - and: [LoadBalancerAnnotationWhereInput!] - or: [LoadBalancerAnnotationWhereInput!] - """id field predicates""" - id: ID - idNEQ: ID - idIn: [ID!] - idNotIn: [ID!] - idGT: ID - idGTE: ID - idLT: ID - idLTE: ID - """created_at field predicates""" - createdAt: Time - createdAtNEQ: Time - createdAtIn: [Time!] - createdAtNotIn: [Time!] - createdAtGT: Time - createdAtGTE: Time - createdAtLT: Time - createdAtLTE: Time - """updated_at field predicates""" - updatedAt: Time - updatedAtNEQ: Time - updatedAtIn: [Time!] - updatedAtNotIn: [Time!] - updatedAtGT: Time - updatedAtGTE: Time - updatedAtLT: Time - updatedAtLTE: Time - """load_balancer edge predicates""" - hasLoadBalancer: Boolean - hasLoadBalancerWith: [LoadBalancerWhereInput!] -} """A connection to a list of items.""" type LoadBalancerConnection { """A list of edges.""" @@ -229,7 +117,7 @@ enum LoadBalancerOrderField { NAME OWNER } -type LoadBalancerOrigin implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Origin") { +type LoadBalancerOrigin implements Node @key(fields: "id") @prefixedID(prefix: "loadogn") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Origin") { id: ID! createdAt: Time! updatedAt: Time! @@ -351,7 +239,7 @@ input LoadBalancerOriginWhereInput { hasPool: Boolean hasPoolWith: [LoadBalancerPoolWhereInput!] } -type LoadBalancerPool implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Pool") { +type LoadBalancerPool implements Node @key(fields: "id") @prefixedID(prefix: "loadpol") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Pool") { id: ID! createdAt: Time! updatedAt: Time! @@ -475,7 +363,7 @@ input LoadBalancerPoolWhereInput { hasOrigins: Boolean hasOriginsWith: [LoadBalancerOriginWhereInput!] } -type LoadBalancerPort implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Port") { +type LoadBalancerPort implements Node @key(fields: "id") @prefixedID(prefix: "loadprt") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Port") { id: ID! createdAt: Time! updatedAt: Time! @@ -580,7 +468,7 @@ input LoadBalancerPortWhereInput { hasLoadBalancer: Boolean hasLoadBalancerWith: [LoadBalancerWhereInput!] } -type LoadBalancerProvider implements Node @key(fields: "id") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Provider") { +type LoadBalancerProvider implements Node @key(fields: "id") @prefixedID(prefix: "loadpvd") @goModel(model: "go.infratographer.com/load-balancer-api/internal/ent/generated.Provider") { """The ID for the load balancer provider.""" id: ID! createdAt: Time! @@ -691,95 +579,6 @@ input LoadBalancerProviderWhereInput { hasLoadBalancers: Boolean hasLoadBalancersWith: [LoadBalancerWhereInput!] } -type LoadBalancerStatus implements Node @key(fields: "id") { - id: ID! - createdAt: Time! - updatedAt: Time! - loadBalancerID: ID! - source: String! - loadBalancer: LoadBalancer! -} -"""A connection to a list of items.""" -type LoadBalancerStatusConnection { - """A list of edges.""" - edges: [LoadBalancerStatusEdge] - """Information to aid in pagination.""" - pageInfo: PageInfo! - """Identifies the total count of items in the connection.""" - totalCount: Int! -} -"""An edge in a connection.""" -type LoadBalancerStatusEdge { - """The item at the end of the edge.""" - node: LoadBalancerStatus - """A cursor for use in pagination.""" - cursor: Cursor! -} -"""Ordering options for LoadBalancerStatus connections""" -input LoadBalancerStatusOrder { - """The ordering direction.""" - direction: OrderDirection! = ASC - """The field by which to order LoadBalancerStatusSlice.""" - field: LoadBalancerStatusOrderField! -} -"""Properties by which LoadBalancerStatus connections can be ordered.""" -enum LoadBalancerStatusOrderField { - CREATED_AT - UPDATED_AT -} -""" -LoadBalancerStatusWhereInput is used for filtering LoadBalancerStatus objects. -Input was generated by ent. -""" -input LoadBalancerStatusWhereInput { - not: LoadBalancerStatusWhereInput - and: [LoadBalancerStatusWhereInput!] - or: [LoadBalancerStatusWhereInput!] - """id field predicates""" - id: ID - idNEQ: ID - idIn: [ID!] - idNotIn: [ID!] - idGT: ID - idGTE: ID - idLT: ID - idLTE: ID - """created_at field predicates""" - createdAt: Time - createdAtNEQ: Time - createdAtIn: [Time!] - createdAtNotIn: [Time!] - createdAtGT: Time - createdAtGTE: Time - createdAtLT: Time - createdAtLTE: Time - """updated_at field predicates""" - updatedAt: Time - updatedAtNEQ: Time - updatedAtIn: [Time!] - updatedAtNotIn: [Time!] - updatedAtGT: Time - updatedAtGTE: Time - updatedAtLT: Time - updatedAtLTE: Time - """source field predicates""" - source: String - sourceNEQ: String - sourceIn: [String!] - sourceNotIn: [String!] - sourceGT: String - sourceGTE: String - sourceLT: String - sourceLTE: String - sourceContains: String - sourceHasPrefix: String - sourceHasSuffix: String - sourceEqualFold: String - sourceContainsFold: String - """load_balancer edge predicates""" - hasLoadBalancer: Boolean - hasLoadBalancerWith: [LoadBalancerWhereInput!] -} """ LoadBalancerWhereInput is used for filtering LoadBalancer objects. Input was generated by ent. @@ -829,12 +628,6 @@ input LoadBalancerWhereInput { nameHasSuffix: String nameEqualFold: String nameContainsFold: String - """annotations edge predicates""" - hasAnnotations: Boolean - hasAnnotationsWith: [LoadBalancerAnnotationWhereInput!] - """statuses edge predicates""" - hasStatuses: Boolean - hasStatusesWith: [LoadBalancerStatusWhereInput!] """ports edge predicates""" hasPorts: Boolean hasPortsWith: [LoadBalancerPortWhereInput!] diff --git a/schema/ipam.graphql b/schema/ipam.graphql index 3e93568b2..da229061e 100644 --- a/schema/ipam.graphql +++ b/schema/ipam.graphql @@ -1,3 +1,3 @@ -extend interface IPv4Addressable { +interface IPAddressable { id: ID! } diff --git a/schema/location.graphql b/schema/location.graphql index 0cf687e9a..130c63fea 100644 --- a/schema/location.graphql +++ b/schema/location.graphql @@ -1,5 +1,7 @@ -extend type Location @key(fields: "id") { - id: ID! @external +directive @prefixedID(prefix: String!) on OBJECT + +type Location @key(fields: "id") { + id: ID! loadBalancers( """ Returns the elements in the list that come after the specified cursor. diff --git a/schema/origin.graphql b/schema/origin.graphql index 4f5a80985..c76513b2d 100644 --- a/schema/origin.graphql +++ b/schema/origin.graphql @@ -1,18 +1,23 @@ -extend type Mutation { - """ - Create a loadbalancer pool origin - """ - loadBalancerOriginCreate(input: CreateLoadBalancerOriginInput!): LoadBalancerOriginCreatePayload! +type Mutation { + """ + Create a loadbalancer pool origin + """ + loadBalancerOriginCreate( + input: CreateLoadBalancerOriginInput! + ): LoadBalancerOriginCreatePayload! - """ - Update a loadbalancer pool origin - """ - loadBalancerOriginUpdate(id: ID!, input: UpdateLoadBalancerOriginInput!): LoadBalancerOriginUpdatePayload! + """ + Update a loadbalancer pool origin + """ + loadBalancerOriginUpdate( + id: ID! + input: UpdateLoadBalancerOriginInput! + ): LoadBalancerOriginUpdatePayload! - """ - Delete a loadbalancer pool origin - """ - loadBalancerOriginDelete(id: ID!): LoadBalancerOriginDeletePayload! + """ + Delete a loadbalancer pool origin + """ + loadBalancerOriginDelete(id: ID!): LoadBalancerOriginDeletePayload! } """ diff --git a/schema/owner.graphql b/schema/owner.graphql index 6954ce445..3f619a83c 100644 --- a/schema/owner.graphql +++ b/schema/owner.graphql @@ -1,5 +1,5 @@ -extend type Owner @key(fields: "id") { - id: ID! @external +type ResourceOwner @interfaceObject @key(fields: "id") { + id: ID! loadBalancers( """ Returns the elements in the list that come after the specified cursor. @@ -99,19 +99,19 @@ extend type LoadBalancer { """ The owner of the load balancer. """ - owner: Owner! @goField(forceResolver: true) + owner: ResourceOwner! @goField(forceResolver: true) } extend type LoadBalancerPool { """ The owner of the load balancer pool. """ - owner: Owner! @goField(forceResolver: true) + owner: ResourceOwner! @goField(forceResolver: true) } extend type LoadBalancerProvider { """ The owner of the load balancer provider. """ - owner: Owner! @goField(forceResolver: true) + owner: ResourceOwner! @goField(forceResolver: true) }