diff --git a/Makefile b/Makefile index 5add6a1b..66152bd7 100644 --- a/Makefile +++ b/Makefile @@ -23,13 +23,13 @@ run-dev: ## Run the dev server .PHONY: stop stop: ## Stop the dev server - @docker-compose down -v + @docker-compose -f compose-dev.yml down -v .PHONY: clean clean: ## Clean up the dev server $(MAKE) stop - @docker compose rm --force + @docker compose -f compose-dev.yml rm --force @docker rmi archivista-archivista --force @@ -56,6 +56,7 @@ docs: ## Generate swagger docs .PHONY: db-migrations db-migrations: ## Run the migrations for the database + @go generate ./... @atlas migrate diff mysql --dir "file://ent/migrate/migrations/mysql" --to "ent://ent/schema" --dev-url "docker://mysql/8/dev" @atlas migrate diff pgsql --dir "file://ent/migrate/migrations/pgsql" --to "ent://ent/schema" --dev-url "docker://postgres/16/dev?search_path=public" diff --git a/ent.graphql b/ent.graphql index 0eae79ec..bc06dfc8 100644 --- a/ent.graphql +++ b/ent.graphql @@ -19,7 +19,9 @@ input AttestationCollectionWhereInput { not: AttestationCollectionWhereInput and: [AttestationCollectionWhereInput!] or: [AttestationCollectionWhereInput!] - """id field predicates""" + """ + id field predicates + """ id: ID idNEQ: ID idIn: [ID!] @@ -28,7 +30,9 @@ input AttestationCollectionWhereInput { idGTE: ID idLT: ID idLTE: ID - """name field predicates""" + """ + name field predicates + """ name: String nameNEQ: String nameIn: [String!] @@ -42,10 +46,90 @@ input AttestationCollectionWhereInput { nameHasSuffix: String nameEqualFold: String nameContainsFold: String - """attestations edge predicates""" + """ + attestations edge predicates + """ hasAttestations: Boolean hasAttestationsWith: [AttestationWhereInput!] - """statement edge predicates""" + """ + statement edge predicates + """ + hasStatement: Boolean + hasStatementWith: [StatementWhereInput!] +} +type AttestationPolicy implements Node { + id: ID! + name: String! + statement: Statement +} +""" +A connection to a list of items. +""" +type AttestationPolicyConnection { + """ + A list of edges. + """ + edges: [AttestationPolicyEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type AttestationPolicyEdge { + """ + The item at the end of the edge. + """ + node: AttestationPolicy + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +AttestationPolicyWhereInput is used for filtering AttestationPolicy objects. +Input was generated by ent. +""" +input AttestationPolicyWhereInput { + not: AttestationPolicyWhereInput + and: [AttestationPolicyWhereInput!] + or: [AttestationPolicyWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """ + 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 + """ + statement edge predicates + """ hasStatement: Boolean hasStatementWith: [StatementWhereInput!] } @@ -57,7 +141,9 @@ input AttestationWhereInput { not: AttestationWhereInput and: [AttestationWhereInput!] or: [AttestationWhereInput!] - """id field predicates""" + """ + id field predicates + """ id: ID idNEQ: ID idIn: [ID!] @@ -66,7 +152,9 @@ input AttestationWhereInput { idGTE: ID idLT: ID idLTE: ID - """type field predicates""" + """ + type field predicates + """ type: String typeNEQ: String typeIn: [String!] @@ -80,7 +168,9 @@ input AttestationWhereInput { typeHasSuffix: String typeEqualFold: String typeContainsFold: String - """attestation_collection edge predicates""" + """ + attestation_collection edge predicates + """ hasAttestationCollection: Boolean hasAttestationCollectionWith: [AttestationCollectionWhereInput!] } @@ -97,20 +187,34 @@ type Dsse implements Node { signatures: [Signature!] payloadDigests: [PayloadDigest!] } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type DsseConnection { - """A list of edges.""" + """ + A list of edges. + """ edges: [DsseEdge] - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """Identifies the total count of items in the connection.""" + """ + Identifies the total count of items in the connection. + """ totalCount: Int! } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type DsseEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: Dsse - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: Cursor! } """ @@ -121,7 +225,9 @@ input DsseWhereInput { not: DsseWhereInput and: [DsseWhereInput!] or: [DsseWhereInput!] - """id field predicates""" + """ + id field predicates + """ id: ID idNEQ: ID idIn: [ID!] @@ -130,7 +236,9 @@ input DsseWhereInput { idGTE: ID idLT: ID idLTE: ID - """gitoid_sha256 field predicates""" + """ + gitoid_sha256 field predicates + """ gitoidSha256: String gitoidSha256NEQ: String gitoidSha256In: [String!] @@ -144,7 +252,9 @@ input DsseWhereInput { gitoidSha256HasSuffix: String gitoidSha256EqualFold: String gitoidSha256ContainsFold: String - """payload_type field predicates""" + """ + payload_type field predicates + """ payloadType: String payloadTypeNEQ: String payloadTypeIn: [String!] @@ -158,13 +268,19 @@ input DsseWhereInput { payloadTypeHasSuffix: String payloadTypeEqualFold: String payloadTypeContainsFold: String - """statement edge predicates""" + """ + statement edge predicates + """ hasStatement: Boolean hasStatementWith: [StatementWhereInput!] - """signatures edge predicates""" + """ + signatures edge predicates + """ hasSignatures: Boolean hasSignaturesWith: [SignatureWhereInput!] - """payload_digests edge predicates""" + """ + payload_digests edge predicates + """ hasPayloadDigests: Boolean hasPayloadDigestsWith: [PayloadDigestWhereInput!] } @@ -173,14 +289,22 @@ An object with an ID. Follows the [Relay Global Object Identification Specification](https://relay.dev/graphql/objectidentification.htm) """ interface Node @goModel(model: "github.com/in-toto/archivista/ent.Noder") { - """The id of the object.""" + """ + The id of the object. + """ id: ID! } -"""Possible directions in which to order a list of items when provided an `orderBy` argument.""" +""" +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.""" + """ + Specifies an ascending order for a given `orderBy` argument. + """ ASC - """Specifies a descending order for a given `orderBy` argument.""" + """ + Specifies a descending order for a given `orderBy` argument. + """ DESC } """ @@ -188,13 +312,21 @@ Information about pagination in a connection. https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo """ type PageInfo { - """When paginating forwards, are there more items?""" + """ + When paginating forwards, are there more items? + """ hasNextPage: Boolean! - """When paginating backwards, are there more items?""" + """ + When paginating backwards, are there more items? + """ hasPreviousPage: Boolean! - """When paginating backwards, the cursor to continue.""" + """ + When paginating backwards, the cursor to continue. + """ startCursor: Cursor - """When paginating forwards, the cursor to continue.""" + """ + When paginating forwards, the cursor to continue. + """ endCursor: Cursor } type PayloadDigest implements Node { @@ -211,7 +343,9 @@ input PayloadDigestWhereInput { not: PayloadDigestWhereInput and: [PayloadDigestWhereInput!] or: [PayloadDigestWhereInput!] - """id field predicates""" + """ + id field predicates + """ id: ID idNEQ: ID idIn: [ID!] @@ -220,7 +354,9 @@ input PayloadDigestWhereInput { idGTE: ID idLT: ID idLTE: ID - """algorithm field predicates""" + """ + algorithm field predicates + """ algorithm: String algorithmNEQ: String algorithmIn: [String!] @@ -234,7 +370,9 @@ input PayloadDigestWhereInput { algorithmHasSuffix: String algorithmEqualFold: String algorithmContainsFold: String - """value field predicates""" + """ + value field predicates + """ value: String valueNEQ: String valueIn: [String!] @@ -248,51 +386,107 @@ input PayloadDigestWhereInput { valueHasSuffix: String valueEqualFold: String valueContainsFold: String - """dsse edge predicates""" + """ + dsse edge predicates + """ hasDsse: Boolean hasDsseWith: [DsseWhereInput!] } type Query { - """Fetches an object given its ID.""" + """ + Fetches an object given its ID. + """ node( - """ID of the object.""" + """ + ID of the object. + """ id: ID! ): Node - """Lookup nodes by a list of IDs.""" + """ + Lookup nodes by a list of IDs. + """ nodes( - """The list of node IDs.""" + """ + The list of node IDs. + """ ids: [ID!]! ): [Node]! + attestationPolicies( + """ + 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 + + """ + Filtering options for AttestationPolicies returned from the connection. + """ + where: AttestationPolicyWhereInput + ): AttestationPolicyConnection! dsses( - """Returns the elements in the list that come after the specified cursor.""" + """ + Returns the elements in the list that come after the specified cursor. + """ after: Cursor - """Returns the first _n_ elements from the list.""" + """ + Returns the first _n_ elements from the list. + """ first: Int - """Returns the elements in the list that come before the specified cursor.""" + """ + Returns the elements in the list that come before the specified cursor. + """ before: Cursor - """Returns the last _n_ elements from the list.""" + """ + Returns the last _n_ elements from the list. + """ last: Int - """Filtering options for Dsses returned from the connection.""" + """ + Filtering options for Dsses returned from the connection. + """ where: DsseWhereInput ): DsseConnection! subjects( - """Returns the elements in the list that come after the specified cursor.""" + """ + Returns the elements in the list that come after the specified cursor. + """ after: Cursor - """Returns the first _n_ elements from the list.""" + """ + Returns the first _n_ elements from the list. + """ first: Int - """Returns the elements in the list that come before the specified cursor.""" + """ + Returns the elements in the list that come before the specified cursor. + """ before: Cursor - """Returns the last _n_ elements from the list.""" + """ + Returns the last _n_ elements from the list. + """ last: Int - """Filtering options for Subjects returned from the connection.""" + """ + Filtering options for Subjects returned from the connection. + """ where: SubjectWhereInput ): SubjectConnection! } @@ -311,7 +505,9 @@ input SignatureWhereInput { not: SignatureWhereInput and: [SignatureWhereInput!] or: [SignatureWhereInput!] - """id field predicates""" + """ + id field predicates + """ id: ID idNEQ: ID idIn: [ID!] @@ -320,7 +516,9 @@ input SignatureWhereInput { idGTE: ID idLT: ID idLTE: ID - """key_id field predicates""" + """ + key_id field predicates + """ keyID: String keyIDNEQ: String keyIDIn: [String!] @@ -334,7 +532,9 @@ input SignatureWhereInput { keyIDHasSuffix: String keyIDEqualFold: String keyIDContainsFold: String - """signature field predicates""" + """ + signature field predicates + """ signature: String signatureNEQ: String signatureIn: [String!] @@ -348,10 +548,14 @@ input SignatureWhereInput { signatureHasSuffix: String signatureEqualFold: String signatureContainsFold: String - """dsse edge predicates""" + """ + dsse edge predicates + """ hasDsse: Boolean hasDsseWith: [DsseWhereInput!] - """timestamps edge predicates""" + """ + timestamps edge predicates + """ hasTimestamps: Boolean hasTimestampsWith: [TimestampWhereInput!] } @@ -359,21 +563,32 @@ type Statement implements Node { id: ID! predicate: String! subjects( - """Returns the elements in the list that come after the specified cursor.""" + """ + Returns the elements in the list that come after the specified cursor. + """ after: Cursor - """Returns the first _n_ elements from the list.""" + """ + Returns the first _n_ elements from the list. + """ first: Int - """Returns the elements in the list that come before the specified cursor.""" + """ + Returns the elements in the list that come before the specified cursor. + """ before: Cursor - """Returns the last _n_ elements from the list.""" + """ + Returns the last _n_ elements from the list. + """ last: Int - """Filtering options for Subjects returned from the connection.""" + """ + Filtering options for Subjects returned from the connection. + """ where: SubjectWhereInput ): SubjectConnection! + policy: AttestationPolicy attestationCollections: AttestationCollection dsse: [Dsse!] } @@ -385,7 +600,9 @@ input StatementWhereInput { not: StatementWhereInput and: [StatementWhereInput!] or: [StatementWhereInput!] - """id field predicates""" + """ + id field predicates + """ id: ID idNEQ: ID idIn: [ID!] @@ -394,7 +611,9 @@ input StatementWhereInput { idGTE: ID idLT: ID idLTE: ID - """predicate field predicates""" + """ + predicate field predicates + """ predicate: String predicateNEQ: String predicateIn: [String!] @@ -408,13 +627,24 @@ input StatementWhereInput { predicateHasSuffix: String predicateEqualFold: String predicateContainsFold: String - """subjects edge predicates""" + """ + subjects edge predicates + """ hasSubjects: Boolean hasSubjectsWith: [SubjectWhereInput!] - """attestation_collections edge predicates""" + """ + policy edge predicates + """ + hasPolicy: Boolean + hasPolicyWith: [AttestationPolicyWhereInput!] + """ + attestation_collections edge predicates + """ hasAttestationCollections: Boolean hasAttestationCollectionsWith: [AttestationCollectionWhereInput!] - """dsse edge predicates""" + """ + dsse edge predicates + """ hasDsse: Boolean hasDsseWith: [DsseWhereInput!] } @@ -424,13 +654,21 @@ type Subject implements Node { subjectDigests: [SubjectDigest!] statement: Statement } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type SubjectConnection { - """A list of edges.""" + """ + A list of edges. + """ edges: [SubjectEdge] - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """Identifies the total count of items in the connection.""" + """ + Identifies the total count of items in the connection. + """ totalCount: Int! } type SubjectDigest implements Node { @@ -447,7 +685,9 @@ input SubjectDigestWhereInput { not: SubjectDigestWhereInput and: [SubjectDigestWhereInput!] or: [SubjectDigestWhereInput!] - """id field predicates""" + """ + id field predicates + """ id: ID idNEQ: ID idIn: [ID!] @@ -456,7 +696,9 @@ input SubjectDigestWhereInput { idGTE: ID idLT: ID idLTE: ID - """algorithm field predicates""" + """ + algorithm field predicates + """ algorithm: String algorithmNEQ: String algorithmIn: [String!] @@ -470,7 +712,9 @@ input SubjectDigestWhereInput { algorithmHasSuffix: String algorithmEqualFold: String algorithmContainsFold: String - """value field predicates""" + """ + value field predicates + """ value: String valueNEQ: String valueIn: [String!] @@ -484,15 +728,23 @@ input SubjectDigestWhereInput { valueHasSuffix: String valueEqualFold: String valueContainsFold: String - """subject edge predicates""" + """ + subject edge predicates + """ hasSubject: Boolean hasSubjectWith: [SubjectWhereInput!] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type SubjectEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: Subject - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: Cursor! } """ @@ -503,7 +755,9 @@ input SubjectWhereInput { not: SubjectWhereInput and: [SubjectWhereInput!] or: [SubjectWhereInput!] - """id field predicates""" + """ + id field predicates + """ id: ID idNEQ: ID idIn: [ID!] @@ -512,7 +766,9 @@ input SubjectWhereInput { idGTE: ID idLT: ID idLTE: ID - """name field predicates""" + """ + name field predicates + """ name: String nameNEQ: String nameIn: [String!] @@ -526,10 +782,14 @@ input SubjectWhereInput { nameHasSuffix: String nameEqualFold: String nameContainsFold: String - """subject_digests edge predicates""" + """ + subject_digests edge predicates + """ hasSubjectDigests: Boolean hasSubjectDigestsWith: [SubjectDigestWhereInput!] - """statement edge predicates""" + """ + statement edge predicates + """ hasStatement: Boolean hasStatementWith: [StatementWhereInput!] } @@ -547,7 +807,9 @@ input TimestampWhereInput { not: TimestampWhereInput and: [TimestampWhereInput!] or: [TimestampWhereInput!] - """id field predicates""" + """ + id field predicates + """ id: ID idNEQ: ID idIn: [ID!] @@ -556,7 +818,9 @@ input TimestampWhereInput { idGTE: ID idLT: ID idLTE: ID - """type field predicates""" + """ + type field predicates + """ type: String typeNEQ: String typeIn: [String!] @@ -570,7 +834,9 @@ input TimestampWhereInput { typeHasSuffix: String typeEqualFold: String typeContainsFold: String - """timestamp field predicates""" + """ + timestamp field predicates + """ timestamp: Time timestampNEQ: Time timestampIn: [Time!] @@ -579,7 +845,9 @@ input TimestampWhereInput { timestampGTE: Time timestampLT: Time timestampLTE: Time - """signature edge predicates""" + """ + signature edge predicates + """ hasSignature: Boolean hasSignatureWith: [SignatureWhereInput!] } diff --git a/ent.resolvers.go b/ent.resolvers.go index 35ffed54..033399fa 100644 --- a/ent.resolvers.go +++ b/ent.resolvers.go @@ -1,4 +1,4 @@ -// Copyright 2023 The Archivista Contributors +// Copyright 2024 The Archivista Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,10 +16,11 @@ package archivista // 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.40 +// Code generated by github.com/99designs/gqlgen version v0.17.45 import ( "context" + "fmt" "entgo.io/contrib/entgql" "github.com/in-toto/archivista/ent" @@ -35,6 +36,11 @@ func (r *queryResolver) Nodes(ctx context.Context, ids []int) ([]ent.Noder, erro return r.client.Noders(ctx, ids) } +// AttestationPolicies is the resolver for the attestationPolicies field. +func (r *queryResolver) AttestationPolicies(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.AttestationPolicyWhereInput) (*ent.AttestationPolicyConnection, error) { + panic(fmt.Errorf("not implemented: AttestationPolicies - attestationPolicies")) +} + // Dsses is the resolver for the dsses field. func (r *queryResolver) Dsses(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.DsseWhereInput) (*ent.DsseConnection, error) { return r.client.Dsse.Query().Paginate(ctx, after, first, before, last, ent.WithDsseFilter(where.Filter)) diff --git a/ent/attestation.go b/ent/attestation.go index 654d11bf..8be2f157 100644 --- a/ent/attestation.go +++ b/ent/attestation.go @@ -40,12 +40,10 @@ type AttestationEdges struct { // AttestationCollectionOrErr returns the AttestationCollection value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. func (e AttestationEdges) AttestationCollectionOrErr() (*AttestationCollection, error) { - if e.loadedTypes[0] { - if e.AttestationCollection == nil { - // Edge was loaded but was not found. - return nil, &NotFoundError{label: attestationcollection.Label} - } + if e.AttestationCollection != nil { return e.AttestationCollection, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: attestationcollection.Label} } return nil, &NotLoadedError{edge: "attestation_collection"} } diff --git a/ent/attestationcollection.go b/ent/attestationcollection.go index f3eda6a0..bd1181ef 100644 --- a/ent/attestationcollection.go +++ b/ent/attestationcollection.go @@ -53,12 +53,10 @@ func (e AttestationCollectionEdges) AttestationsOrErr() ([]*Attestation, error) // StatementOrErr returns the Statement value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. func (e AttestationCollectionEdges) StatementOrErr() (*Statement, error) { - if e.loadedTypes[1] { - if e.Statement == nil { - // Edge was loaded but was not found. - return nil, &NotFoundError{label: statement.Label} - } + if e.Statement != nil { return e.Statement, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: statement.Label} } return nil, &NotLoadedError{edge: "statement"} } diff --git a/ent/attestationpolicy.go b/ent/attestationpolicy.go new file mode 100644 index 00000000..ed653e31 --- /dev/null +++ b/ent/attestationpolicy.go @@ -0,0 +1,144 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "fmt" + "strings" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/in-toto/archivista/ent/attestationpolicy" + "github.com/in-toto/archivista/ent/statement" +) + +// AttestationPolicy is the model entity for the AttestationPolicy schema. +type AttestationPolicy struct { + config `json:"-"` + // ID of the ent. + ID int `json:"id,omitempty"` + // Name holds the value of the "name" field. + Name string `json:"name,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the AttestationPolicyQuery when eager-loading is set. + Edges AttestationPolicyEdges `json:"edges"` + statement_policy *int + selectValues sql.SelectValues +} + +// AttestationPolicyEdges holds the relations/edges for other nodes in the graph. +type AttestationPolicyEdges struct { + // Statement holds the value of the statement edge. + Statement *Statement `json:"statement,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 +} + +// StatementOrErr returns the Statement value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e AttestationPolicyEdges) StatementOrErr() (*Statement, error) { + if e.Statement != nil { + return e.Statement, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: statement.Label} + } + return nil, &NotLoadedError{edge: "statement"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*AttestationPolicy) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case attestationpolicy.FieldID: + values[i] = new(sql.NullInt64) + case attestationpolicy.FieldName: + values[i] = new(sql.NullString) + case attestationpolicy.ForeignKeys[0]: // statement_policy + values[i] = new(sql.NullInt64) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the AttestationPolicy fields. +func (ap *AttestationPolicy) 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 attestationpolicy.FieldID: + value, ok := values[i].(*sql.NullInt64) + if !ok { + return fmt.Errorf("unexpected type %T for field id", value) + } + ap.ID = int(value.Int64) + case attestationpolicy.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + ap.Name = value.String + } + case attestationpolicy.ForeignKeys[0]: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for edge-field statement_policy", value) + } else if value.Valid { + ap.statement_policy = new(int) + *ap.statement_policy = int(value.Int64) + } + default: + ap.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the AttestationPolicy. +// This includes values selected through modifiers, order, etc. +func (ap *AttestationPolicy) Value(name string) (ent.Value, error) { + return ap.selectValues.Get(name) +} + +// QueryStatement queries the "statement" edge of the AttestationPolicy entity. +func (ap *AttestationPolicy) QueryStatement() *StatementQuery { + return NewAttestationPolicyClient(ap.config).QueryStatement(ap) +} + +// Update returns a builder for updating this AttestationPolicy. +// Note that you need to call AttestationPolicy.Unwrap() before calling this method if this AttestationPolicy +// was returned from a transaction, and the transaction was committed or rolled back. +func (ap *AttestationPolicy) Update() *AttestationPolicyUpdateOne { + return NewAttestationPolicyClient(ap.config).UpdateOne(ap) +} + +// Unwrap unwraps the AttestationPolicy 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 (ap *AttestationPolicy) Unwrap() *AttestationPolicy { + _tx, ok := ap.config.driver.(*txDriver) + if !ok { + panic("ent: AttestationPolicy is not a transactional entity") + } + ap.config.driver = _tx.drv + return ap +} + +// String implements the fmt.Stringer. +func (ap *AttestationPolicy) String() string { + var builder strings.Builder + builder.WriteString("AttestationPolicy(") + builder.WriteString(fmt.Sprintf("id=%v, ", ap.ID)) + builder.WriteString("name=") + builder.WriteString(ap.Name) + builder.WriteByte(')') + return builder.String() +} + +// AttestationPolicies is a parsable slice of AttestationPolicy. +type AttestationPolicies []*AttestationPolicy diff --git a/ent/attestationpolicy/attestationpolicy.go b/ent/attestationpolicy/attestationpolicy.go new file mode 100644 index 00000000..005fb2a3 --- /dev/null +++ b/ent/attestationpolicy/attestationpolicy.go @@ -0,0 +1,87 @@ +// Code generated by ent, DO NOT EDIT. + +package attestationpolicy + +import ( + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the attestationpolicy type in the database. + Label = "attestation_policy" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // EdgeStatement holds the string denoting the statement edge name in mutations. + EdgeStatement = "statement" + // Table holds the table name of the attestationpolicy in the database. + Table = "attestation_policies" + // StatementTable is the table that holds the statement relation/edge. + StatementTable = "attestation_policies" + // StatementInverseTable is the table name for the Statement entity. + // It exists in this package in order to avoid circular dependency with the "statement" package. + StatementInverseTable = "statements" + // StatementColumn is the table column denoting the statement relation/edge. + StatementColumn = "statement_policy" +) + +// Columns holds all SQL columns for attestationpolicy fields. +var Columns = []string{ + FieldID, + FieldName, +} + +// ForeignKeys holds the SQL foreign-keys that are owned by the "attestation_policies" +// table and are not defined as standalone fields in the schema. +var ForeignKeys = []string{ + "statement_policy", +} + +// 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 + } + } + for i := range ForeignKeys { + if column == ForeignKeys[i] { + return true + } + } + return false +} + +var ( + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error +) + +// OrderOption defines the ordering options for the AttestationPolicy 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() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByStatementField orders the results by statement field. +func ByStatementField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newStatementStep(), sql.OrderByField(field, opts...)) + } +} +func newStatementStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(StatementInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, StatementTable, StatementColumn), + ) +} diff --git a/ent/attestationpolicy/where.go b/ent/attestationpolicy/where.go new file mode 100644 index 00000000..a9124fa7 --- /dev/null +++ b/ent/attestationpolicy/where.go @@ -0,0 +1,162 @@ +// Code generated by ent, DO NOT EDIT. + +package attestationpolicy + +import ( + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/in-toto/archivista/ent/predicate" +) + +// ID filters vertices based on their ID field. +func ID(id int) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id int) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id int) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...int) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...int) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id int) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id int) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id int) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id int) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldLTE(FieldID, id)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldEQ(FieldName, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.FieldContainsFold(FieldName, v)) +} + +// HasStatement applies the HasEdge predicate on the "statement" edge. +func HasStatement() predicate.AttestationPolicy { + return predicate.AttestationPolicy(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, StatementTable, StatementColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasStatementWith applies the HasEdge predicate on the "statement" edge with a given conditions (other predicates). +func HasStatementWith(preds ...predicate.Statement) predicate.AttestationPolicy { + return predicate.AttestationPolicy(func(s *sql.Selector) { + step := newStatementStep() + 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.AttestationPolicy) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.AttestationPolicy) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.AttestationPolicy) predicate.AttestationPolicy { + return predicate.AttestationPolicy(sql.NotPredicates(p)) +} diff --git a/ent/attestationpolicy_create.go b/ent/attestationpolicy_create.go new file mode 100644 index 00000000..830efea6 --- /dev/null +++ b/ent/attestationpolicy_create.go @@ -0,0 +1,225 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/in-toto/archivista/ent/attestationpolicy" + "github.com/in-toto/archivista/ent/statement" +) + +// AttestationPolicyCreate is the builder for creating a AttestationPolicy entity. +type AttestationPolicyCreate struct { + config + mutation *AttestationPolicyMutation + hooks []Hook +} + +// SetName sets the "name" field. +func (apc *AttestationPolicyCreate) SetName(s string) *AttestationPolicyCreate { + apc.mutation.SetName(s) + return apc +} + +// SetStatementID sets the "statement" edge to the Statement entity by ID. +func (apc *AttestationPolicyCreate) SetStatementID(id int) *AttestationPolicyCreate { + apc.mutation.SetStatementID(id) + return apc +} + +// SetNillableStatementID sets the "statement" edge to the Statement entity by ID if the given value is not nil. +func (apc *AttestationPolicyCreate) SetNillableStatementID(id *int) *AttestationPolicyCreate { + if id != nil { + apc = apc.SetStatementID(*id) + } + return apc +} + +// SetStatement sets the "statement" edge to the Statement entity. +func (apc *AttestationPolicyCreate) SetStatement(s *Statement) *AttestationPolicyCreate { + return apc.SetStatementID(s.ID) +} + +// Mutation returns the AttestationPolicyMutation object of the builder. +func (apc *AttestationPolicyCreate) Mutation() *AttestationPolicyMutation { + return apc.mutation +} + +// Save creates the AttestationPolicy in the database. +func (apc *AttestationPolicyCreate) Save(ctx context.Context) (*AttestationPolicy, error) { + return withHooks(ctx, apc.sqlSave, apc.mutation, apc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (apc *AttestationPolicyCreate) SaveX(ctx context.Context) *AttestationPolicy { + v, err := apc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (apc *AttestationPolicyCreate) Exec(ctx context.Context) error { + _, err := apc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (apc *AttestationPolicyCreate) ExecX(ctx context.Context) { + if err := apc.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (apc *AttestationPolicyCreate) check() error { + if _, ok := apc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`ent: missing required field "AttestationPolicy.name"`)} + } + if v, ok := apc.mutation.Name(); ok { + if err := attestationpolicy.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "AttestationPolicy.name": %w`, err)} + } + } + return nil +} + +func (apc *AttestationPolicyCreate) sqlSave(ctx context.Context) (*AttestationPolicy, error) { + if err := apc.check(); err != nil { + return nil, err + } + _node, _spec := apc.createSpec() + if err := sqlgraph.CreateNode(ctx, apc.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + id := _spec.ID.Value.(int64) + _node.ID = int(id) + apc.mutation.id = &_node.ID + apc.mutation.done = true + return _node, nil +} + +func (apc *AttestationPolicyCreate) createSpec() (*AttestationPolicy, *sqlgraph.CreateSpec) { + var ( + _node = &AttestationPolicy{config: apc.config} + _spec = sqlgraph.NewCreateSpec(attestationpolicy.Table, sqlgraph.NewFieldSpec(attestationpolicy.FieldID, field.TypeInt)) + ) + if value, ok := apc.mutation.Name(); ok { + _spec.SetField(attestationpolicy.FieldName, field.TypeString, value) + _node.Name = value + } + if nodes := apc.mutation.StatementIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: attestationpolicy.StatementTable, + Columns: []string{attestationpolicy.StatementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(statement.FieldID, field.TypeInt), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.statement_policy = &nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// AttestationPolicyCreateBulk is the builder for creating many AttestationPolicy entities in bulk. +type AttestationPolicyCreateBulk struct { + config + err error + builders []*AttestationPolicyCreate +} + +// Save creates the AttestationPolicy entities in the database. +func (apcb *AttestationPolicyCreateBulk) Save(ctx context.Context) ([]*AttestationPolicy, error) { + if apcb.err != nil { + return nil, apcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(apcb.builders)) + nodes := make([]*AttestationPolicy, len(apcb.builders)) + mutators := make([]Mutator, len(apcb.builders)) + for i := range apcb.builders { + func(i int, root context.Context) { + builder := apcb.builders[i] + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*AttestationPolicyMutation) + 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, apcb.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, apcb.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + if specs[i].ID.Value != nil { + id := specs[i].ID.Value.(int64) + nodes[i].ID = int(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, apcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (apcb *AttestationPolicyCreateBulk) SaveX(ctx context.Context) []*AttestationPolicy { + v, err := apcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (apcb *AttestationPolicyCreateBulk) Exec(ctx context.Context) error { + _, err := apcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (apcb *AttestationPolicyCreateBulk) ExecX(ctx context.Context) { + if err := apcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/ent/attestationpolicy_delete.go b/ent/attestationpolicy_delete.go new file mode 100644 index 00000000..def7c519 --- /dev/null +++ b/ent/attestationpolicy_delete.go @@ -0,0 +1,88 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/in-toto/archivista/ent/attestationpolicy" + "github.com/in-toto/archivista/ent/predicate" +) + +// AttestationPolicyDelete is the builder for deleting a AttestationPolicy entity. +type AttestationPolicyDelete struct { + config + hooks []Hook + mutation *AttestationPolicyMutation +} + +// Where appends a list predicates to the AttestationPolicyDelete builder. +func (apd *AttestationPolicyDelete) Where(ps ...predicate.AttestationPolicy) *AttestationPolicyDelete { + apd.mutation.Where(ps...) + return apd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (apd *AttestationPolicyDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, apd.sqlExec, apd.mutation, apd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (apd *AttestationPolicyDelete) ExecX(ctx context.Context) int { + n, err := apd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (apd *AttestationPolicyDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(attestationpolicy.Table, sqlgraph.NewFieldSpec(attestationpolicy.FieldID, field.TypeInt)) + if ps := apd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, apd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + apd.mutation.done = true + return affected, err +} + +// AttestationPolicyDeleteOne is the builder for deleting a single AttestationPolicy entity. +type AttestationPolicyDeleteOne struct { + apd *AttestationPolicyDelete +} + +// Where appends a list predicates to the AttestationPolicyDelete builder. +func (apdo *AttestationPolicyDeleteOne) Where(ps ...predicate.AttestationPolicy) *AttestationPolicyDeleteOne { + apdo.apd.mutation.Where(ps...) + return apdo +} + +// Exec executes the deletion query. +func (apdo *AttestationPolicyDeleteOne) Exec(ctx context.Context) error { + n, err := apdo.apd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{attestationpolicy.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (apdo *AttestationPolicyDeleteOne) ExecX(ctx context.Context) { + if err := apdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/ent/attestationpolicy_query.go b/ent/attestationpolicy_query.go new file mode 100644 index 00000000..dfa2c4ff --- /dev/null +++ b/ent/attestationpolicy_query.go @@ -0,0 +1,626 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "fmt" + "math" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/in-toto/archivista/ent/attestationpolicy" + "github.com/in-toto/archivista/ent/predicate" + "github.com/in-toto/archivista/ent/statement" +) + +// AttestationPolicyQuery is the builder for querying AttestationPolicy entities. +type AttestationPolicyQuery struct { + config + ctx *QueryContext + order []attestationpolicy.OrderOption + inters []Interceptor + predicates []predicate.AttestationPolicy + withStatement *StatementQuery + withFKs bool + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*AttestationPolicy) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the AttestationPolicyQuery builder. +func (apq *AttestationPolicyQuery) Where(ps ...predicate.AttestationPolicy) *AttestationPolicyQuery { + apq.predicates = append(apq.predicates, ps...) + return apq +} + +// Limit the number of records to be returned by this query. +func (apq *AttestationPolicyQuery) Limit(limit int) *AttestationPolicyQuery { + apq.ctx.Limit = &limit + return apq +} + +// Offset to start from. +func (apq *AttestationPolicyQuery) Offset(offset int) *AttestationPolicyQuery { + apq.ctx.Offset = &offset + return apq +} + +// 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 (apq *AttestationPolicyQuery) Unique(unique bool) *AttestationPolicyQuery { + apq.ctx.Unique = &unique + return apq +} + +// Order specifies how the records should be ordered. +func (apq *AttestationPolicyQuery) Order(o ...attestationpolicy.OrderOption) *AttestationPolicyQuery { + apq.order = append(apq.order, o...) + return apq +} + +// QueryStatement chains the current query on the "statement" edge. +func (apq *AttestationPolicyQuery) QueryStatement() *StatementQuery { + query := (&StatementClient{config: apq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := apq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := apq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(attestationpolicy.Table, attestationpolicy.FieldID, selector), + sqlgraph.To(statement.Table, statement.FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, attestationpolicy.StatementTable, attestationpolicy.StatementColumn), + ) + fromU = sqlgraph.SetNeighbors(apq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first AttestationPolicy entity from the query. +// Returns a *NotFoundError when no AttestationPolicy was found. +func (apq *AttestationPolicyQuery) First(ctx context.Context) (*AttestationPolicy, error) { + nodes, err := apq.Limit(1).All(setContextOp(ctx, apq.ctx, "First")) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{attestationpolicy.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (apq *AttestationPolicyQuery) FirstX(ctx context.Context) *AttestationPolicy { + node, err := apq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first AttestationPolicy ID from the query. +// Returns a *NotFoundError when no AttestationPolicy ID was found. +func (apq *AttestationPolicyQuery) FirstID(ctx context.Context) (id int, err error) { + var ids []int + if ids, err = apq.Limit(1).IDs(setContextOp(ctx, apq.ctx, "FirstID")); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{attestationpolicy.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (apq *AttestationPolicyQuery) FirstIDX(ctx context.Context) int { + id, err := apq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single AttestationPolicy entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one AttestationPolicy entity is found. +// Returns a *NotFoundError when no AttestationPolicy entities are found. +func (apq *AttestationPolicyQuery) Only(ctx context.Context) (*AttestationPolicy, error) { + nodes, err := apq.Limit(2).All(setContextOp(ctx, apq.ctx, "Only")) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{attestationpolicy.Label} + default: + return nil, &NotSingularError{attestationpolicy.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (apq *AttestationPolicyQuery) OnlyX(ctx context.Context) *AttestationPolicy { + node, err := apq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only AttestationPolicy ID in the query. +// Returns a *NotSingularError when more than one AttestationPolicy ID is found. +// Returns a *NotFoundError when no entities are found. +func (apq *AttestationPolicyQuery) OnlyID(ctx context.Context) (id int, err error) { + var ids []int + if ids, err = apq.Limit(2).IDs(setContextOp(ctx, apq.ctx, "OnlyID")); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{attestationpolicy.Label} + default: + err = &NotSingularError{attestationpolicy.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (apq *AttestationPolicyQuery) OnlyIDX(ctx context.Context) int { + id, err := apq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of AttestationPolicies. +func (apq *AttestationPolicyQuery) All(ctx context.Context) ([]*AttestationPolicy, error) { + ctx = setContextOp(ctx, apq.ctx, "All") + if err := apq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*AttestationPolicy, *AttestationPolicyQuery]() + return withInterceptors[[]*AttestationPolicy](ctx, apq, qr, apq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (apq *AttestationPolicyQuery) AllX(ctx context.Context) []*AttestationPolicy { + nodes, err := apq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of AttestationPolicy IDs. +func (apq *AttestationPolicyQuery) IDs(ctx context.Context) (ids []int, err error) { + if apq.ctx.Unique == nil && apq.path != nil { + apq.Unique(true) + } + ctx = setContextOp(ctx, apq.ctx, "IDs") + if err = apq.Select(attestationpolicy.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (apq *AttestationPolicyQuery) IDsX(ctx context.Context) []int { + ids, err := apq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (apq *AttestationPolicyQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, apq.ctx, "Count") + if err := apq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, apq, querierCount[*AttestationPolicyQuery](), apq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (apq *AttestationPolicyQuery) CountX(ctx context.Context) int { + count, err := apq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (apq *AttestationPolicyQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, apq.ctx, "Exist") + switch _, err := apq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("ent: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (apq *AttestationPolicyQuery) ExistX(ctx context.Context) bool { + exist, err := apq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the AttestationPolicyQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (apq *AttestationPolicyQuery) Clone() *AttestationPolicyQuery { + if apq == nil { + return nil + } + return &AttestationPolicyQuery{ + config: apq.config, + ctx: apq.ctx.Clone(), + order: append([]attestationpolicy.OrderOption{}, apq.order...), + inters: append([]Interceptor{}, apq.inters...), + predicates: append([]predicate.AttestationPolicy{}, apq.predicates...), + withStatement: apq.withStatement.Clone(), + // clone intermediate query. + sql: apq.sql.Clone(), + path: apq.path, + } +} + +// WithStatement tells the query-builder to eager-load the nodes that are connected to +// the "statement" edge. The optional arguments are used to configure the query builder of the edge. +func (apq *AttestationPolicyQuery) WithStatement(opts ...func(*StatementQuery)) *AttestationPolicyQuery { + query := (&StatementClient{config: apq.config}).Query() + for _, opt := range opts { + opt(query) + } + apq.withStatement = query + return apq +} + +// 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 { +// Name string `json:"name,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.AttestationPolicy.Query(). +// GroupBy(attestationpolicy.FieldName). +// Aggregate(ent.Count()). +// Scan(ctx, &v) +func (apq *AttestationPolicyQuery) GroupBy(field string, fields ...string) *AttestationPolicyGroupBy { + apq.ctx.Fields = append([]string{field}, fields...) + grbuild := &AttestationPolicyGroupBy{build: apq} + grbuild.flds = &apq.ctx.Fields + grbuild.label = attestationpolicy.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 { +// Name string `json:"name,omitempty"` +// } +// +// client.AttestationPolicy.Query(). +// Select(attestationpolicy.FieldName). +// Scan(ctx, &v) +func (apq *AttestationPolicyQuery) Select(fields ...string) *AttestationPolicySelect { + apq.ctx.Fields = append(apq.ctx.Fields, fields...) + sbuild := &AttestationPolicySelect{AttestationPolicyQuery: apq} + sbuild.label = attestationpolicy.Label + sbuild.flds, sbuild.scan = &apq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a AttestationPolicySelect configured with the given aggregations. +func (apq *AttestationPolicyQuery) Aggregate(fns ...AggregateFunc) *AttestationPolicySelect { + return apq.Select().Aggregate(fns...) +} + +func (apq *AttestationPolicyQuery) prepareQuery(ctx context.Context) error { + for _, inter := range apq.inters { + if inter == nil { + return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, apq); err != nil { + return err + } + } + } + for _, f := range apq.ctx.Fields { + if !attestationpolicy.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + } + if apq.path != nil { + prev, err := apq.path(ctx) + if err != nil { + return err + } + apq.sql = prev + } + return nil +} + +func (apq *AttestationPolicyQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*AttestationPolicy, error) { + var ( + nodes = []*AttestationPolicy{} + withFKs = apq.withFKs + _spec = apq.querySpec() + loadedTypes = [1]bool{ + apq.withStatement != nil, + } + ) + if apq.withStatement != nil { + withFKs = true + } + if withFKs { + _spec.Node.Columns = append(_spec.Node.Columns, attestationpolicy.ForeignKeys...) + } + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*AttestationPolicy).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &AttestationPolicy{config: apq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + if len(apq.modifiers) > 0 { + _spec.Modifiers = apq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, apq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := apq.withStatement; query != nil { + if err := apq.loadStatement(ctx, query, nodes, nil, + func(n *AttestationPolicy, e *Statement) { n.Edges.Statement = e }); err != nil { + return nil, err + } + } + for i := range apq.loadTotal { + if err := apq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (apq *AttestationPolicyQuery) loadStatement(ctx context.Context, query *StatementQuery, nodes []*AttestationPolicy, init func(*AttestationPolicy), assign func(*AttestationPolicy, *Statement)) error { + ids := make([]int, 0, len(nodes)) + nodeids := make(map[int][]*AttestationPolicy) + for i := range nodes { + if nodes[i].statement_policy == nil { + continue + } + fk := *nodes[i].statement_policy + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(statement.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 "statement_policy" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (apq *AttestationPolicyQuery) sqlCount(ctx context.Context) (int, error) { + _spec := apq.querySpec() + if len(apq.modifiers) > 0 { + _spec.Modifiers = apq.modifiers + } + _spec.Node.Columns = apq.ctx.Fields + if len(apq.ctx.Fields) > 0 { + _spec.Unique = apq.ctx.Unique != nil && *apq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, apq.driver, _spec) +} + +func (apq *AttestationPolicyQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(attestationpolicy.Table, attestationpolicy.Columns, sqlgraph.NewFieldSpec(attestationpolicy.FieldID, field.TypeInt)) + _spec.From = apq.sql + if unique := apq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if apq.path != nil { + _spec.Unique = true + } + if fields := apq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, attestationpolicy.FieldID) + for i := range fields { + if fields[i] != attestationpolicy.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := apq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := apq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := apq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := apq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (apq *AttestationPolicyQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(apq.driver.Dialect()) + t1 := builder.Table(attestationpolicy.Table) + columns := apq.ctx.Fields + if len(columns) == 0 { + columns = attestationpolicy.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if apq.sql != nil { + selector = apq.sql + selector.Select(selector.Columns(columns...)...) + } + if apq.ctx.Unique != nil && *apq.ctx.Unique { + selector.Distinct() + } + for _, p := range apq.predicates { + p(selector) + } + for _, p := range apq.order { + p(selector) + } + if offset := apq.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 := apq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// AttestationPolicyGroupBy is the group-by builder for AttestationPolicy entities. +type AttestationPolicyGroupBy struct { + selector + build *AttestationPolicyQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (apgb *AttestationPolicyGroupBy) Aggregate(fns ...AggregateFunc) *AttestationPolicyGroupBy { + apgb.fns = append(apgb.fns, fns...) + return apgb +} + +// Scan applies the selector query and scans the result into the given value. +func (apgb *AttestationPolicyGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, apgb.build.ctx, "GroupBy") + if err := apgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*AttestationPolicyQuery, *AttestationPolicyGroupBy](ctx, apgb.build, apgb, apgb.build.inters, v) +} + +func (apgb *AttestationPolicyGroupBy) sqlScan(ctx context.Context, root *AttestationPolicyQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(apgb.fns)) + for _, fn := range apgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*apgb.flds)+len(apgb.fns)) + for _, f := range *apgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*apgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := apgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// AttestationPolicySelect is the builder for selecting fields of AttestationPolicy entities. +type AttestationPolicySelect struct { + *AttestationPolicyQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (aps *AttestationPolicySelect) Aggregate(fns ...AggregateFunc) *AttestationPolicySelect { + aps.fns = append(aps.fns, fns...) + return aps +} + +// Scan applies the selector query and scans the result into the given value. +func (aps *AttestationPolicySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, aps.ctx, "Select") + if err := aps.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*AttestationPolicyQuery, *AttestationPolicySelect](ctx, aps.AttestationPolicyQuery, aps, aps.inters, v) +} + +func (aps *AttestationPolicySelect) sqlScan(ctx context.Context, root *AttestationPolicyQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(aps.fns)) + for _, fn := range aps.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*aps.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 := aps.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/ent/attestationpolicy_update.go b/ent/attestationpolicy_update.go new file mode 100644 index 00000000..3443d551 --- /dev/null +++ b/ent/attestationpolicy_update.go @@ -0,0 +1,344 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/in-toto/archivista/ent/attestationpolicy" + "github.com/in-toto/archivista/ent/predicate" + "github.com/in-toto/archivista/ent/statement" +) + +// AttestationPolicyUpdate is the builder for updating AttestationPolicy entities. +type AttestationPolicyUpdate struct { + config + hooks []Hook + mutation *AttestationPolicyMutation +} + +// Where appends a list predicates to the AttestationPolicyUpdate builder. +func (apu *AttestationPolicyUpdate) Where(ps ...predicate.AttestationPolicy) *AttestationPolicyUpdate { + apu.mutation.Where(ps...) + return apu +} + +// SetName sets the "name" field. +func (apu *AttestationPolicyUpdate) SetName(s string) *AttestationPolicyUpdate { + apu.mutation.SetName(s) + return apu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (apu *AttestationPolicyUpdate) SetNillableName(s *string) *AttestationPolicyUpdate { + if s != nil { + apu.SetName(*s) + } + return apu +} + +// SetStatementID sets the "statement" edge to the Statement entity by ID. +func (apu *AttestationPolicyUpdate) SetStatementID(id int) *AttestationPolicyUpdate { + apu.mutation.SetStatementID(id) + return apu +} + +// SetNillableStatementID sets the "statement" edge to the Statement entity by ID if the given value is not nil. +func (apu *AttestationPolicyUpdate) SetNillableStatementID(id *int) *AttestationPolicyUpdate { + if id != nil { + apu = apu.SetStatementID(*id) + } + return apu +} + +// SetStatement sets the "statement" edge to the Statement entity. +func (apu *AttestationPolicyUpdate) SetStatement(s *Statement) *AttestationPolicyUpdate { + return apu.SetStatementID(s.ID) +} + +// Mutation returns the AttestationPolicyMutation object of the builder. +func (apu *AttestationPolicyUpdate) Mutation() *AttestationPolicyMutation { + return apu.mutation +} + +// ClearStatement clears the "statement" edge to the Statement entity. +func (apu *AttestationPolicyUpdate) ClearStatement() *AttestationPolicyUpdate { + apu.mutation.ClearStatement() + return apu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (apu *AttestationPolicyUpdate) Save(ctx context.Context) (int, error) { + return withHooks(ctx, apu.sqlSave, apu.mutation, apu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (apu *AttestationPolicyUpdate) SaveX(ctx context.Context) int { + affected, err := apu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (apu *AttestationPolicyUpdate) Exec(ctx context.Context) error { + _, err := apu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (apu *AttestationPolicyUpdate) ExecX(ctx context.Context) { + if err := apu.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (apu *AttestationPolicyUpdate) check() error { + if v, ok := apu.mutation.Name(); ok { + if err := attestationpolicy.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "AttestationPolicy.name": %w`, err)} + } + } + return nil +} + +func (apu *AttestationPolicyUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := apu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(attestationpolicy.Table, attestationpolicy.Columns, sqlgraph.NewFieldSpec(attestationpolicy.FieldID, field.TypeInt)) + if ps := apu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := apu.mutation.Name(); ok { + _spec.SetField(attestationpolicy.FieldName, field.TypeString, value) + } + if apu.mutation.StatementCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: attestationpolicy.StatementTable, + Columns: []string{attestationpolicy.StatementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(statement.FieldID, field.TypeInt), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := apu.mutation.StatementIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: attestationpolicy.StatementTable, + Columns: []string{attestationpolicy.StatementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(statement.FieldID, field.TypeInt), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if n, err = sqlgraph.UpdateNodes(ctx, apu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{attestationpolicy.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + apu.mutation.done = true + return n, nil +} + +// AttestationPolicyUpdateOne is the builder for updating a single AttestationPolicy entity. +type AttestationPolicyUpdateOne struct { + config + fields []string + hooks []Hook + mutation *AttestationPolicyMutation +} + +// SetName sets the "name" field. +func (apuo *AttestationPolicyUpdateOne) SetName(s string) *AttestationPolicyUpdateOne { + apuo.mutation.SetName(s) + return apuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (apuo *AttestationPolicyUpdateOne) SetNillableName(s *string) *AttestationPolicyUpdateOne { + if s != nil { + apuo.SetName(*s) + } + return apuo +} + +// SetStatementID sets the "statement" edge to the Statement entity by ID. +func (apuo *AttestationPolicyUpdateOne) SetStatementID(id int) *AttestationPolicyUpdateOne { + apuo.mutation.SetStatementID(id) + return apuo +} + +// SetNillableStatementID sets the "statement" edge to the Statement entity by ID if the given value is not nil. +func (apuo *AttestationPolicyUpdateOne) SetNillableStatementID(id *int) *AttestationPolicyUpdateOne { + if id != nil { + apuo = apuo.SetStatementID(*id) + } + return apuo +} + +// SetStatement sets the "statement" edge to the Statement entity. +func (apuo *AttestationPolicyUpdateOne) SetStatement(s *Statement) *AttestationPolicyUpdateOne { + return apuo.SetStatementID(s.ID) +} + +// Mutation returns the AttestationPolicyMutation object of the builder. +func (apuo *AttestationPolicyUpdateOne) Mutation() *AttestationPolicyMutation { + return apuo.mutation +} + +// ClearStatement clears the "statement" edge to the Statement entity. +func (apuo *AttestationPolicyUpdateOne) ClearStatement() *AttestationPolicyUpdateOne { + apuo.mutation.ClearStatement() + return apuo +} + +// Where appends a list predicates to the AttestationPolicyUpdate builder. +func (apuo *AttestationPolicyUpdateOne) Where(ps ...predicate.AttestationPolicy) *AttestationPolicyUpdateOne { + apuo.mutation.Where(ps...) + return apuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (apuo *AttestationPolicyUpdateOne) Select(field string, fields ...string) *AttestationPolicyUpdateOne { + apuo.fields = append([]string{field}, fields...) + return apuo +} + +// Save executes the query and returns the updated AttestationPolicy entity. +func (apuo *AttestationPolicyUpdateOne) Save(ctx context.Context) (*AttestationPolicy, error) { + return withHooks(ctx, apuo.sqlSave, apuo.mutation, apuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (apuo *AttestationPolicyUpdateOne) SaveX(ctx context.Context) *AttestationPolicy { + node, err := apuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (apuo *AttestationPolicyUpdateOne) Exec(ctx context.Context) error { + _, err := apuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (apuo *AttestationPolicyUpdateOne) ExecX(ctx context.Context) { + if err := apuo.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (apuo *AttestationPolicyUpdateOne) check() error { + if v, ok := apuo.mutation.Name(); ok { + if err := attestationpolicy.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "AttestationPolicy.name": %w`, err)} + } + } + return nil +} + +func (apuo *AttestationPolicyUpdateOne) sqlSave(ctx context.Context) (_node *AttestationPolicy, err error) { + if err := apuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(attestationpolicy.Table, attestationpolicy.Columns, sqlgraph.NewFieldSpec(attestationpolicy.FieldID, field.TypeInt)) + id, ok := apuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "AttestationPolicy.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := apuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, attestationpolicy.FieldID) + for _, f := range fields { + if !attestationpolicy.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + if f != attestationpolicy.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := apuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := apuo.mutation.Name(); ok { + _spec.SetField(attestationpolicy.FieldName, field.TypeString, value) + } + if apuo.mutation.StatementCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: attestationpolicy.StatementTable, + Columns: []string{attestationpolicy.StatementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(statement.FieldID, field.TypeInt), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := apuo.mutation.StatementIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: attestationpolicy.StatementTable, + Columns: []string{attestationpolicy.StatementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(statement.FieldID, field.TypeInt), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _node = &AttestationPolicy{config: apuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, apuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{attestationpolicy.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + apuo.mutation.done = true + return _node, nil +} diff --git a/ent/client.go b/ent/client.go index b9ae49e5..81c42fdf 100644 --- a/ent/client.go +++ b/ent/client.go @@ -17,6 +17,7 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/dsse" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/signature" @@ -35,6 +36,8 @@ type Client struct { Attestation *AttestationClient // AttestationCollection is the client for interacting with the AttestationCollection builders. AttestationCollection *AttestationCollectionClient + // AttestationPolicy is the client for interacting with the AttestationPolicy builders. + AttestationPolicy *AttestationPolicyClient // Dsse is the client for interacting with the Dsse builders. Dsse *DsseClient // PayloadDigest is the client for interacting with the PayloadDigest builders. @@ -64,6 +67,7 @@ func (c *Client) init() { c.Schema = migrate.NewSchema(c.driver) c.Attestation = NewAttestationClient(c.config) c.AttestationCollection = NewAttestationCollectionClient(c.config) + c.AttestationPolicy = NewAttestationPolicyClient(c.config) c.Dsse = NewDsseClient(c.config) c.PayloadDigest = NewPayloadDigestClient(c.config) c.Signature = NewSignatureClient(c.config) @@ -165,6 +169,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) { config: cfg, Attestation: NewAttestationClient(cfg), AttestationCollection: NewAttestationCollectionClient(cfg), + AttestationPolicy: NewAttestationPolicyClient(cfg), Dsse: NewDsseClient(cfg), PayloadDigest: NewPayloadDigestClient(cfg), Signature: NewSignatureClient(cfg), @@ -193,6 +198,7 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) config: cfg, Attestation: NewAttestationClient(cfg), AttestationCollection: NewAttestationCollectionClient(cfg), + AttestationPolicy: NewAttestationPolicyClient(cfg), Dsse: NewDsseClient(cfg), PayloadDigest: NewPayloadDigestClient(cfg), Signature: NewSignatureClient(cfg), @@ -229,8 +235,9 @@ func (c *Client) Close() error { // 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.Attestation, c.AttestationCollection, c.Dsse, c.PayloadDigest, c.Signature, - c.Statement, c.Subject, c.SubjectDigest, c.Timestamp, + c.Attestation, c.AttestationCollection, c.AttestationPolicy, c.Dsse, + c.PayloadDigest, c.Signature, c.Statement, c.Subject, c.SubjectDigest, + c.Timestamp, } { n.Use(hooks...) } @@ -240,8 +247,9 @@ func (c *Client) Use(hooks ...Hook) { // 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.Attestation, c.AttestationCollection, c.Dsse, c.PayloadDigest, c.Signature, - c.Statement, c.Subject, c.SubjectDigest, c.Timestamp, + c.Attestation, c.AttestationCollection, c.AttestationPolicy, c.Dsse, + c.PayloadDigest, c.Signature, c.Statement, c.Subject, c.SubjectDigest, + c.Timestamp, } { n.Intercept(interceptors...) } @@ -254,6 +262,8 @@ func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) { return c.Attestation.mutate(ctx, m) case *AttestationCollectionMutation: return c.AttestationCollection.mutate(ctx, m) + case *AttestationPolicyMutation: + return c.AttestationPolicy.mutate(ctx, m) case *DsseMutation: return c.Dsse.mutate(ctx, m) case *PayloadDigestMutation: @@ -587,6 +597,155 @@ func (c *AttestationCollectionClient) mutate(ctx context.Context, m *Attestation } } +// AttestationPolicyClient is a client for the AttestationPolicy schema. +type AttestationPolicyClient struct { + config +} + +// NewAttestationPolicyClient returns a client for the AttestationPolicy from the given config. +func NewAttestationPolicyClient(c config) *AttestationPolicyClient { + return &AttestationPolicyClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `attestationpolicy.Hooks(f(g(h())))`. +func (c *AttestationPolicyClient) Use(hooks ...Hook) { + c.hooks.AttestationPolicy = append(c.hooks.AttestationPolicy, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `attestationpolicy.Intercept(f(g(h())))`. +func (c *AttestationPolicyClient) Intercept(interceptors ...Interceptor) { + c.inters.AttestationPolicy = append(c.inters.AttestationPolicy, interceptors...) +} + +// Create returns a builder for creating a AttestationPolicy entity. +func (c *AttestationPolicyClient) Create() *AttestationPolicyCreate { + mutation := newAttestationPolicyMutation(c.config, OpCreate) + return &AttestationPolicyCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of AttestationPolicy entities. +func (c *AttestationPolicyClient) CreateBulk(builders ...*AttestationPolicyCreate) *AttestationPolicyCreateBulk { + return &AttestationPolicyCreateBulk{config: c.config, builders: builders} +} + +// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates +// a builder and applies setFunc on it. +func (c *AttestationPolicyClient) MapCreateBulk(slice any, setFunc func(*AttestationPolicyCreate, int)) *AttestationPolicyCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &AttestationPolicyCreateBulk{err: fmt.Errorf("calling to AttestationPolicyClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*AttestationPolicyCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &AttestationPolicyCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for AttestationPolicy. +func (c *AttestationPolicyClient) Update() *AttestationPolicyUpdate { + mutation := newAttestationPolicyMutation(c.config, OpUpdate) + return &AttestationPolicyUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *AttestationPolicyClient) UpdateOne(ap *AttestationPolicy) *AttestationPolicyUpdateOne { + mutation := newAttestationPolicyMutation(c.config, OpUpdateOne, withAttestationPolicy(ap)) + return &AttestationPolicyUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *AttestationPolicyClient) UpdateOneID(id int) *AttestationPolicyUpdateOne { + mutation := newAttestationPolicyMutation(c.config, OpUpdateOne, withAttestationPolicyID(id)) + return &AttestationPolicyUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for AttestationPolicy. +func (c *AttestationPolicyClient) Delete() *AttestationPolicyDelete { + mutation := newAttestationPolicyMutation(c.config, OpDelete) + return &AttestationPolicyDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *AttestationPolicyClient) DeleteOne(ap *AttestationPolicy) *AttestationPolicyDeleteOne { + return c.DeleteOneID(ap.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *AttestationPolicyClient) DeleteOneID(id int) *AttestationPolicyDeleteOne { + builder := c.Delete().Where(attestationpolicy.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &AttestationPolicyDeleteOne{builder} +} + +// Query returns a query builder for AttestationPolicy. +func (c *AttestationPolicyClient) Query() *AttestationPolicyQuery { + return &AttestationPolicyQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeAttestationPolicy}, + inters: c.Interceptors(), + } +} + +// Get returns a AttestationPolicy entity by its id. +func (c *AttestationPolicyClient) Get(ctx context.Context, id int) (*AttestationPolicy, error) { + return c.Query().Where(attestationpolicy.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *AttestationPolicyClient) GetX(ctx context.Context, id int) *AttestationPolicy { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryStatement queries the statement edge of a AttestationPolicy. +func (c *AttestationPolicyClient) QueryStatement(ap *AttestationPolicy) *StatementQuery { + query := (&StatementClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := ap.ID + step := sqlgraph.NewStep( + sqlgraph.From(attestationpolicy.Table, attestationpolicy.FieldID, id), + sqlgraph.To(statement.Table, statement.FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, attestationpolicy.StatementTable, attestationpolicy.StatementColumn), + ) + fromV = sqlgraph.Neighbors(ap.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *AttestationPolicyClient) Hooks() []Hook { + return c.hooks.AttestationPolicy +} + +// Interceptors returns the client interceptors. +func (c *AttestationPolicyClient) Interceptors() []Interceptor { + return c.inters.AttestationPolicy +} + +func (c *AttestationPolicyClient) mutate(ctx context.Context, m *AttestationPolicyMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&AttestationPolicyCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&AttestationPolicyUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&AttestationPolicyUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&AttestationPolicyDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("ent: unknown AttestationPolicy mutation op: %q", m.Op()) + } +} + // DsseClient is a client for the Dsse schema. type DsseClient struct { config @@ -1206,6 +1365,22 @@ func (c *StatementClient) QuerySubjects(s *Statement) *SubjectQuery { return query } +// QueryPolicy queries the policy edge of a Statement. +func (c *StatementClient) QueryPolicy(s *Statement) *AttestationPolicyQuery { + query := (&AttestationPolicyClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := s.ID + step := sqlgraph.NewStep( + sqlgraph.From(statement.Table, statement.FieldID, id), + sqlgraph.To(attestationpolicy.Table, attestationpolicy.FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, statement.PolicyTable, statement.PolicyColumn), + ) + fromV = sqlgraph.Neighbors(s.driver.Dialect(), step) + return fromV, nil + } + return query +} + // QueryAttestationCollections queries the attestation_collections edge of a Statement. func (c *StatementClient) QueryAttestationCollections(s *Statement) *AttestationCollectionQuery { query := (&AttestationCollectionClient{config: c.config}).Query() @@ -1729,11 +1904,11 @@ func (c *TimestampClient) mutate(ctx context.Context, m *TimestampMutation) (Val // hooks and interceptors per client, for fast access. type ( hooks struct { - Attestation, AttestationCollection, Dsse, PayloadDigest, Signature, Statement, - Subject, SubjectDigest, Timestamp []ent.Hook + Attestation, AttestationCollection, AttestationPolicy, Dsse, PayloadDigest, + Signature, Statement, Subject, SubjectDigest, Timestamp []ent.Hook } inters struct { - Attestation, AttestationCollection, Dsse, PayloadDigest, Signature, Statement, - Subject, SubjectDigest, Timestamp []ent.Interceptor + Attestation, AttestationCollection, AttestationPolicy, Dsse, PayloadDigest, + Signature, Statement, Subject, SubjectDigest, Timestamp []ent.Interceptor } ) diff --git a/ent/dsse.go b/ent/dsse.go index 92995ef2..402e71fe 100644 --- a/ent/dsse.go +++ b/ent/dsse.go @@ -49,12 +49,10 @@ type DsseEdges struct { // StatementOrErr returns the Statement value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. func (e DsseEdges) StatementOrErr() (*Statement, error) { - if e.loadedTypes[0] { - if e.Statement == nil { - // Edge was loaded but was not found. - return nil, &NotFoundError{label: statement.Label} - } + if e.Statement != nil { return e.Statement, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: statement.Label} } return nil, &NotLoadedError{edge: "statement"} } diff --git a/ent/ent.go b/ent/ent.go index 5be617a6..a84a145b 100644 --- a/ent/ent.go +++ b/ent/ent.go @@ -14,6 +14,7 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/dsse" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/signature" @@ -83,6 +84,7 @@ func checkColumn(table, column string) error { columnCheck = sql.NewColumnCheck(map[string]func(string) bool{ attestation.Table: attestation.ValidColumn, attestationcollection.Table: attestationcollection.ValidColumn, + attestationpolicy.Table: attestationpolicy.ValidColumn, dsse.Table: dsse.ValidColumn, payloaddigest.Table: payloaddigest.ValidColumn, signature.Table: signature.ValidColumn, diff --git a/ent/gql_collection.go b/ent/gql_collection.go index 10e95742..282c69f5 100644 --- a/ent/gql_collection.go +++ b/ent/gql_collection.go @@ -11,6 +11,7 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/dsse" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/signature" @@ -186,6 +187,83 @@ func newAttestationCollectionPaginateArgs(rv map[string]any) *attestationcollect return args } +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (ap *AttestationPolicyQuery) CollectFields(ctx context.Context, satisfies ...string) (*AttestationPolicyQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return ap, nil + } + if err := ap.collectField(ctx, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return ap, nil +} + +func (ap *AttestationPolicyQuery) 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(attestationpolicy.Columns)) + selectedFields = []string{attestationpolicy.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "statement": + var ( + alias = field.Alias + path = append(path, alias) + query = (&StatementClient{config: ap.config}).Query() + ) + if err := query.collectField(ctx, opCtx, field, path, satisfies...); err != nil { + return err + } + ap.withStatement = query + case "name": + if _, ok := fieldSeen[attestationpolicy.FieldName]; !ok { + selectedFields = append(selectedFields, attestationpolicy.FieldName) + fieldSeen[attestationpolicy.FieldName] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + ap.Select(selectedFields...) + } + return nil +} + +type attestationpolicyPaginateArgs struct { + first, last *int + after, before *Cursor + opts []AttestationPolicyPaginateOption +} + +func newAttestationPolicyPaginateArgs(rv map[string]any) *attestationpolicyPaginateArgs { + args := &attestationpolicyPaginateArgs{} + 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[whereField].(*AttestationPolicyWhereInput); ok { + args.opts = append(args.opts, WithAttestationPolicyFilter(v.Filter)) + } + return args +} + // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. func (d *DsseQuery) CollectFields(ctx context.Context, satisfies ...string) (*DsseQuery, error) { fc := graphql.GetFieldContext(ctx) @@ -573,6 +651,16 @@ func (s *StatementQuery) collectField(ctx context.Context, opCtx *graphql.Operat s.WithNamedSubjects(alias, func(wq *SubjectQuery) { *wq = *query }) + case "policy": + var ( + alias = field.Alias + path = append(path, alias) + query = (&AttestationPolicyClient{config: s.config}).Query() + ) + if err := query.collectField(ctx, opCtx, field, path, satisfies...); err != nil { + return err + } + s.withPolicy = query case "attestationCollections": var ( alias = field.Alias diff --git a/ent/gql_edge.go b/ent/gql_edge.go index 9497978d..19957b71 100644 --- a/ent/gql_edge.go +++ b/ent/gql_edge.go @@ -36,6 +36,14 @@ func (ac *AttestationCollection) Statement(ctx context.Context) (*Statement, err return result, err } +func (ap *AttestationPolicy) Statement(ctx context.Context) (*Statement, error) { + result, err := ap.Edges.StatementOrErr() + if IsNotLoaded(err) { + result, err = ap.QueryStatement().Only(ctx) + } + return result, MaskNotFound(err) +} + func (d *Dsse) Statement(ctx context.Context) (*Statement, error) { result, err := d.Edges.StatementOrErr() if IsNotLoaded(err) { @@ -116,6 +124,14 @@ func (s *Statement) Subjects( return s.QuerySubjects().Paginate(ctx, after, first, before, last, opts...) } +func (s *Statement) Policy(ctx context.Context) (*AttestationPolicy, error) { + result, err := s.Edges.PolicyOrErr() + if IsNotLoaded(err) { + result, err = s.QueryPolicy().Only(ctx) + } + return result, MaskNotFound(err) +} + func (s *Statement) AttestationCollections(ctx context.Context) (*AttestationCollection, error) { result, err := s.Edges.AttestationCollectionsOrErr() if IsNotLoaded(err) { diff --git a/ent/gql_node.go b/ent/gql_node.go index da3a83af..fa4943fa 100644 --- a/ent/gql_node.go +++ b/ent/gql_node.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/go-multierror" "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/dsse" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/signature" @@ -37,6 +38,9 @@ func (n *Attestation) IsNode() {} // IsNode implements the Node interface check for GQLGen. func (n *AttestationCollection) IsNode() {} +// IsNode implements the Node interface check for GQLGen. +func (n *AttestationPolicy) IsNode() {} + // IsNode implements the Node interface check for GQLGen. func (n *Dsse) IsNode() {} @@ -140,6 +144,18 @@ func (c *Client) noder(ctx context.Context, table string, id int) (Noder, error) return nil, err } return n, nil + case attestationpolicy.Table: + query := c.AttestationPolicy.Query(). + Where(attestationpolicy.ID(id)) + query, err := query.CollectFields(ctx, "AttestationPolicy") + if err != nil { + return nil, err + } + n, err := query.Only(ctx) + if err != nil { + return nil, err + } + return n, nil case dsse.Table: query := c.Dsse.Query(). Where(dsse.ID(id)) @@ -329,6 +345,22 @@ func (c *Client) noders(ctx context.Context, table string, ids []int) ([]Noder, *noder = node } } + case attestationpolicy.Table: + query := c.AttestationPolicy.Query(). + Where(attestationpolicy.IDIn(ids...)) + query, err := query.CollectFields(ctx, "AttestationPolicy") + 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 dsse.Table: query := c.Dsse.Query(). Where(dsse.IDIn(ids...)) diff --git a/ent/gql_pagination.go b/ent/gql_pagination.go index 1e2bbe4f..28104ef8 100644 --- a/ent/gql_pagination.go +++ b/ent/gql_pagination.go @@ -13,6 +13,7 @@ import ( "github.com/99designs/gqlgen/graphql/errcode" "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/dsse" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/signature" @@ -595,6 +596,252 @@ func (ac *AttestationCollection) ToEdge(order *AttestationCollectionOrder) *Atte } } +// AttestationPolicyEdge is the edge representation of AttestationPolicy. +type AttestationPolicyEdge struct { + Node *AttestationPolicy `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// AttestationPolicyConnection is the connection containing edges to AttestationPolicy. +type AttestationPolicyConnection struct { + Edges []*AttestationPolicyEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *AttestationPolicyConnection) build(nodes []*AttestationPolicy, pager *attestationpolicyPager, 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) *AttestationPolicy + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *AttestationPolicy { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *AttestationPolicy { + return nodes[i] + } + } + c.Edges = make([]*AttestationPolicyEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &AttestationPolicyEdge{ + 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) + } +} + +// AttestationPolicyPaginateOption enables pagination customization. +type AttestationPolicyPaginateOption func(*attestationpolicyPager) error + +// WithAttestationPolicyOrder configures pagination ordering. +func WithAttestationPolicyOrder(order *AttestationPolicyOrder) AttestationPolicyPaginateOption { + if order == nil { + order = DefaultAttestationPolicyOrder + } + o := *order + return func(pager *attestationpolicyPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultAttestationPolicyOrder.Field + } + pager.order = &o + return nil + } +} + +// WithAttestationPolicyFilter configures pagination filter. +func WithAttestationPolicyFilter(filter func(*AttestationPolicyQuery) (*AttestationPolicyQuery, error)) AttestationPolicyPaginateOption { + return func(pager *attestationpolicyPager) error { + if filter == nil { + return errors.New("AttestationPolicyQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type attestationpolicyPager struct { + reverse bool + order *AttestationPolicyOrder + filter func(*AttestationPolicyQuery) (*AttestationPolicyQuery, error) +} + +func newAttestationPolicyPager(opts []AttestationPolicyPaginateOption, reverse bool) (*attestationpolicyPager, error) { + pager := &attestationpolicyPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultAttestationPolicyOrder + } + return pager, nil +} + +func (p *attestationpolicyPager) applyFilter(query *AttestationPolicyQuery) (*AttestationPolicyQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *attestationpolicyPager) toCursor(ap *AttestationPolicy) Cursor { + return p.order.Field.toCursor(ap) +} + +func (p *attestationpolicyPager) applyCursors(query *AttestationPolicyQuery, after, before *Cursor) (*AttestationPolicyQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultAttestationPolicyOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *attestationpolicyPager) applyOrder(query *AttestationPolicyQuery) *AttestationPolicyQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultAttestationPolicyOrder.Field { + query = query.Order(DefaultAttestationPolicyOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *attestationpolicyPager) orderExpr(query *AttestationPolicyQuery) 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 != DefaultAttestationPolicyOrder.Field { + b.Comma().Ident(DefaultAttestationPolicyOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to AttestationPolicy. +func (ap *AttestationPolicyQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...AttestationPolicyPaginateOption, +) (*AttestationPolicyConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newAttestationPolicyPager(opts, last != nil) + if err != nil { + return nil, err + } + if ap, err = pager.applyFilter(ap); err != nil { + return nil, err + } + conn := &AttestationPolicyConnection{Edges: []*AttestationPolicyEdge{}} + 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 = ap.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 ap, err = pager.applyCursors(ap, after, before); err != nil { + return nil, err + } + if limit := paginateLimit(first, last); limit != 0 { + ap.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := ap.collectField(ctx, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + ap = pager.applyOrder(ap) + nodes, err := ap.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// AttestationPolicyOrderField defines the ordering field of AttestationPolicy. +type AttestationPolicyOrderField struct { + // Value extracts the ordering value from the given AttestationPolicy. + Value func(*AttestationPolicy) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) attestationpolicy.OrderOption + toCursor func(*AttestationPolicy) Cursor +} + +// AttestationPolicyOrder defines the ordering of AttestationPolicy. +type AttestationPolicyOrder struct { + Direction OrderDirection `json:"direction"` + Field *AttestationPolicyOrderField `json:"field"` +} + +// DefaultAttestationPolicyOrder is the default ordering of AttestationPolicy. +var DefaultAttestationPolicyOrder = &AttestationPolicyOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &AttestationPolicyOrderField{ + Value: func(ap *AttestationPolicy) (ent.Value, error) { + return ap.ID, nil + }, + column: attestationpolicy.FieldID, + toTerm: attestationpolicy.ByID, + toCursor: func(ap *AttestationPolicy) Cursor { + return Cursor{ID: ap.ID} + }, + }, +} + +// ToEdge converts AttestationPolicy into AttestationPolicyEdge. +func (ap *AttestationPolicy) ToEdge(order *AttestationPolicyOrder) *AttestationPolicyEdge { + if order == nil { + order = DefaultAttestationPolicyOrder + } + return &AttestationPolicyEdge{ + Node: ap, + Cursor: order.Field.toCursor(ap), + } +} + // DsseEdge is the edge representation of Dsse. type DsseEdge struct { Node *Dsse `json:"node"` diff --git a/ent/gql_where_input.go b/ent/gql_where_input.go index a1171ec4..4e511031 100644 --- a/ent/gql_where_input.go +++ b/ent/gql_where_input.go @@ -9,6 +9,7 @@ import ( "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/dsse" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/predicate" @@ -441,6 +442,206 @@ func (i *AttestationCollectionWhereInput) P() (predicate.AttestationCollection, } } +// AttestationPolicyWhereInput represents a where input for filtering AttestationPolicy queries. +type AttestationPolicyWhereInput struct { + Predicates []predicate.AttestationPolicy `json:"-"` + Not *AttestationPolicyWhereInput `json:"not,omitempty"` + Or []*AttestationPolicyWhereInput `json:"or,omitempty"` + And []*AttestationPolicyWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *int `json:"id,omitempty"` + IDNEQ *int `json:"idNEQ,omitempty"` + IDIn []int `json:"idIn,omitempty"` + IDNotIn []int `json:"idNotIn,omitempty"` + IDGT *int `json:"idGT,omitempty"` + IDGTE *int `json:"idGTE,omitempty"` + IDLT *int `json:"idLT,omitempty"` + IDLTE *int `json:"idLTE,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "statement" edge predicates. + HasStatement *bool `json:"hasStatement,omitempty"` + HasStatementWith []*StatementWhereInput `json:"hasStatementWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *AttestationPolicyWhereInput) AddPredicates(predicates ...predicate.AttestationPolicy) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the AttestationPolicyWhereInput filter on the AttestationPolicyQuery builder. +func (i *AttestationPolicyWhereInput) Filter(q *AttestationPolicyQuery) (*AttestationPolicyQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyAttestationPolicyWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyAttestationPolicyWhereInput is returned in case the AttestationPolicyWhereInput is empty. +var ErrEmptyAttestationPolicyWhereInput = errors.New("ent: empty predicate AttestationPolicyWhereInput") + +// P returns a predicate for filtering attestationpolicies. +// An error is returned if the input is empty or invalid. +func (i *AttestationPolicyWhereInput) P() (predicate.AttestationPolicy, error) { + var predicates []predicate.AttestationPolicy + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, attestationpolicy.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.AttestationPolicy, 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, attestationpolicy.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.AttestationPolicy, 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, attestationpolicy.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, attestationpolicy.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, attestationpolicy.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, attestationpolicy.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, attestationpolicy.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, attestationpolicy.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, attestationpolicy.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, attestationpolicy.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, attestationpolicy.IDLTE(*i.IDLTE)) + } + if i.Name != nil { + predicates = append(predicates, attestationpolicy.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, attestationpolicy.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, attestationpolicy.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, attestationpolicy.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, attestationpolicy.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, attestationpolicy.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, attestationpolicy.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, attestationpolicy.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, attestationpolicy.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, attestationpolicy.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, attestationpolicy.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, attestationpolicy.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, attestationpolicy.NameContainsFold(*i.NameContainsFold)) + } + + if i.HasStatement != nil { + p := attestationpolicy.HasStatement() + if !*i.HasStatement { + p = attestationpolicy.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasStatementWith) > 0 { + with := make([]predicate.Statement, 0, len(i.HasStatementWith)) + for _, w := range i.HasStatementWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasStatementWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, attestationpolicy.HasStatementWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyAttestationPolicyWhereInput + case 1: + return predicates[0], nil + default: + return attestationpolicy.And(predicates...), nil + } +} + // DsseWhereInput represents a where input for filtering Dsse queries. type DsseWhereInput struct { Predicates []predicate.Dsse `json:"-"` @@ -1305,6 +1506,10 @@ type StatementWhereInput struct { HasSubjects *bool `json:"hasSubjects,omitempty"` HasSubjectsWith []*SubjectWhereInput `json:"hasSubjectsWith,omitempty"` + // "policy" edge predicates. + HasPolicy *bool `json:"hasPolicy,omitempty"` + HasPolicyWith []*AttestationPolicyWhereInput `json:"hasPolicyWith,omitempty"` + // "attestation_collections" edge predicates. HasAttestationCollections *bool `json:"hasAttestationCollections,omitempty"` HasAttestationCollectionsWith []*AttestationCollectionWhereInput `json:"hasAttestationCollectionsWith,omitempty"` @@ -1467,6 +1672,24 @@ func (i *StatementWhereInput) P() (predicate.Statement, error) { } predicates = append(predicates, statement.HasSubjectsWith(with...)) } + if i.HasPolicy != nil { + p := statement.HasPolicy() + if !*i.HasPolicy { + p = statement.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasPolicyWith) > 0 { + with := make([]predicate.AttestationPolicy, 0, len(i.HasPolicyWith)) + for _, w := range i.HasPolicyWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasPolicyWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, statement.HasPolicyWith(with...)) + } if i.HasAttestationCollections != nil { p := statement.HasAttestationCollections() if !*i.HasAttestationCollections { diff --git a/ent/hook/hook.go b/ent/hook/hook.go index 49c93201..a4f9b6f4 100644 --- a/ent/hook/hook.go +++ b/ent/hook/hook.go @@ -33,6 +33,18 @@ func (f AttestationCollectionFunc) Mutate(ctx context.Context, m ent.Mutation) ( return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.AttestationCollectionMutation", m) } +// The AttestationPolicyFunc type is an adapter to allow the use of ordinary +// function as AttestationPolicy mutator. +type AttestationPolicyFunc func(context.Context, *ent.AttestationPolicyMutation) (ent.Value, error) + +// Mutate calls f(ctx, m). +func (f AttestationPolicyFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if mv, ok := m.(*ent.AttestationPolicyMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.AttestationPolicyMutation", m) +} + // The DsseFunc type is an adapter to allow the use of ordinary // function as Dsse mutator. type DsseFunc func(context.Context, *ent.DsseMutation) (ent.Value, error) diff --git a/ent/migrate/migrations/mysql/20240412085222_mysql.sql b/ent/migrate/migrations/mysql/20240412085222_mysql.sql new file mode 100644 index 00000000..b4f413d8 --- /dev/null +++ b/ent/migrate/migrations/mysql/20240412085222_mysql.sql @@ -0,0 +1,2 @@ +-- Create "attestation_policies" table +CREATE TABLE `attestation_policies` (`id` bigint NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `statement_policy` bigint NULL, PRIMARY KEY (`id`), INDEX `attestationpolicy_name` (`name`), UNIQUE INDEX `statement_policy` (`statement_policy`), CONSTRAINT `attestation_policies_statements_policy` FOREIGN KEY (`statement_policy`) REFERENCES `statements` (`id`) ON UPDATE NO ACTION ON DELETE SET NULL) CHARSET utf8mb4 COLLATE utf8mb4_bin; diff --git a/ent/migrate/migrations/mysql/atlas.sum b/ent/migrate/migrations/mysql/atlas.sum index d5c5e73e..a9adf4e2 100644 --- a/ent/migrate/migrations/mysql/atlas.sum +++ b/ent/migrate/migrations/mysql/atlas.sum @@ -1,2 +1,3 @@ -h1:uz2B9rkm7QWMNJE8Lp0NAr4JOcWFeRO6+MgSc/SBwqY= +h1:1Ow/eZVMLy44Vylv2ewQF1uQtT3+kvN1yTCa+4JQ5MI= 20231214165639_mysql.sql h1:rqSqoXUOtdEpJT04rLCzyyPJC+NYRjQj9jXHZW+Oq9Q= +20240412085222_mysql.sql h1:V7ePmRzeLat9gKTFnWvZnZIZe+r6OBu0bCS/xeVMPg8= diff --git a/ent/migrate/migrations/pgsql/20240412085224_pgsql.sql b/ent/migrate/migrations/pgsql/20240412085224_pgsql.sql new file mode 100644 index 00000000..f597b456 --- /dev/null +++ b/ent/migrate/migrations/pgsql/20240412085224_pgsql.sql @@ -0,0 +1,6 @@ +-- Create "attestation_policies" table +CREATE TABLE "attestation_policies" ("id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, "name" character varying NOT NULL, "statement_policy" bigint NULL, PRIMARY KEY ("id"), CONSTRAINT "attestation_policies_statements_policy" FOREIGN KEY ("statement_policy") REFERENCES "statements" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "attestation_policies_statement_policy_key" to table: "attestation_policies" +CREATE UNIQUE INDEX "attestation_policies_statement_policy_key" ON "attestation_policies" ("statement_policy"); +-- Create index "attestationpolicy_name" to table: "attestation_policies" +CREATE INDEX "attestationpolicy_name" ON "attestation_policies" ("name"); diff --git a/ent/migrate/migrations/pgsql/atlas.sum b/ent/migrate/migrations/pgsql/atlas.sum index 86d00d52..033e45fa 100644 --- a/ent/migrate/migrations/pgsql/atlas.sum +++ b/ent/migrate/migrations/pgsql/atlas.sum @@ -1,2 +1,3 @@ -h1:0dyKf7c5dDT+Vk7LvKiAeEQAH9aBJcynyXc0Ru44eDo= +h1:D/veOuP9Sr5oRpHC8Ow9Td7h4BufsLknJawwIfzTdN0= 20231214165922_pgsql.sql h1:AZaZD6/98yKVFL6svm7gPpKlD1EL6fk8juLh+SW765I= +20240412085224_pgsql.sql h1:OLX7vanfNS1O24Gp8Jeb/1pQJWJKs9cghXJNZ5pwTUc= diff --git a/ent/migrate/schema.go b/ent/migrate/schema.go index 7611cf15..20ab26cb 100644 --- a/ent/migrate/schema.go +++ b/ent/migrate/schema.go @@ -62,6 +62,33 @@ var ( }, }, } + // AttestationPoliciesColumns holds the columns for the "attestation_policies" table. + AttestationPoliciesColumns = []*schema.Column{ + {Name: "id", Type: field.TypeInt, Increment: true}, + {Name: "name", Type: field.TypeString}, + {Name: "statement_policy", Type: field.TypeInt, Unique: true, Nullable: true}, + } + // AttestationPoliciesTable holds the schema information for the "attestation_policies" table. + AttestationPoliciesTable = &schema.Table{ + Name: "attestation_policies", + Columns: AttestationPoliciesColumns, + PrimaryKey: []*schema.Column{AttestationPoliciesColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "attestation_policies_statements_policy", + Columns: []*schema.Column{AttestationPoliciesColumns[2]}, + RefColumns: []*schema.Column{StatementsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "attestationpolicy_name", + Unique: false, + Columns: []*schema.Column{AttestationPoliciesColumns[1]}, + }, + }, + } // DssesColumns holds the columns for the "dsses" table. DssesColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt, Increment: true}, @@ -237,6 +264,7 @@ var ( Tables = []*schema.Table{ AttestationsTable, AttestationCollectionsTable, + AttestationPoliciesTable, DssesTable, PayloadDigestsTable, SignaturesTable, @@ -250,6 +278,7 @@ var ( func init() { AttestationsTable.ForeignKeys[0].RefTable = AttestationCollectionsTable AttestationCollectionsTable.ForeignKeys[0].RefTable = StatementsTable + AttestationPoliciesTable.ForeignKeys[0].RefTable = StatementsTable DssesTable.ForeignKeys[0].RefTable = StatementsTable PayloadDigestsTable.ForeignKeys[0].RefTable = DssesTable SignaturesTable.ForeignKeys[0].RefTable = DssesTable diff --git a/ent/mutation.go b/ent/mutation.go index 11261cf5..699c685d 100644 --- a/ent/mutation.go +++ b/ent/mutation.go @@ -13,6 +13,7 @@ import ( "entgo.io/ent/dialect/sql" "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/dsse" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/predicate" @@ -34,6 +35,7 @@ const ( // Node types. TypeAttestation = "Attestation" TypeAttestationCollection = "AttestationCollection" + TypeAttestationPolicy = "AttestationPolicy" TypeDsse = "Dsse" TypePayloadDigest = "PayloadDigest" TypeSignature = "Signature" @@ -914,6 +916,399 @@ func (m *AttestationCollectionMutation) ResetEdge(name string) error { return fmt.Errorf("unknown AttestationCollection edge %s", name) } +// AttestationPolicyMutation represents an operation that mutates the AttestationPolicy nodes in the graph. +type AttestationPolicyMutation struct { + config + op Op + typ string + id *int + name *string + clearedFields map[string]struct{} + statement *int + clearedstatement bool + done bool + oldValue func(context.Context) (*AttestationPolicy, error) + predicates []predicate.AttestationPolicy +} + +var _ ent.Mutation = (*AttestationPolicyMutation)(nil) + +// attestationpolicyOption allows management of the mutation configuration using functional options. +type attestationpolicyOption func(*AttestationPolicyMutation) + +// newAttestationPolicyMutation creates new mutation for the AttestationPolicy entity. +func newAttestationPolicyMutation(c config, op Op, opts ...attestationpolicyOption) *AttestationPolicyMutation { + m := &AttestationPolicyMutation{ + config: c, + op: op, + typ: TypeAttestationPolicy, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withAttestationPolicyID sets the ID field of the mutation. +func withAttestationPolicyID(id int) attestationpolicyOption { + return func(m *AttestationPolicyMutation) { + var ( + err error + once sync.Once + value *AttestationPolicy + ) + m.oldValue = func(ctx context.Context) (*AttestationPolicy, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().AttestationPolicy.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withAttestationPolicy sets the old AttestationPolicy of the mutation. +func withAttestationPolicy(node *AttestationPolicy) attestationpolicyOption { + return func(m *AttestationPolicyMutation) { + m.oldValue = func(context.Context) (*AttestationPolicy, 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 AttestationPolicyMutation) 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 AttestationPolicyMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// 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 *AttestationPolicyMutation) ID() (id int, 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 *AttestationPolicyMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().AttestationPolicy.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetName sets the "name" field. +func (m *AttestationPolicyMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *AttestationPolicyMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the AttestationPolicy entity. +// If the AttestationPolicy 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 *AttestationPolicyMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *AttestationPolicyMutation) ResetName() { + m.name = nil +} + +// SetStatementID sets the "statement" edge to the Statement entity by id. +func (m *AttestationPolicyMutation) SetStatementID(id int) { + m.statement = &id +} + +// ClearStatement clears the "statement" edge to the Statement entity. +func (m *AttestationPolicyMutation) ClearStatement() { + m.clearedstatement = true +} + +// StatementCleared reports if the "statement" edge to the Statement entity was cleared. +func (m *AttestationPolicyMutation) StatementCleared() bool { + return m.clearedstatement +} + +// StatementID returns the "statement" edge ID in the mutation. +func (m *AttestationPolicyMutation) StatementID() (id int, exists bool) { + if m.statement != nil { + return *m.statement, true + } + return +} + +// StatementIDs returns the "statement" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// StatementID instead. It exists only for internal usage by the builders. +func (m *AttestationPolicyMutation) StatementIDs() (ids []int) { + if id := m.statement; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetStatement resets all changes to the "statement" edge. +func (m *AttestationPolicyMutation) ResetStatement() { + m.statement = nil + m.clearedstatement = false +} + +// Where appends a list predicates to the AttestationPolicyMutation builder. +func (m *AttestationPolicyMutation) Where(ps ...predicate.AttestationPolicy) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the AttestationPolicyMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *AttestationPolicyMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.AttestationPolicy, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *AttestationPolicyMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *AttestationPolicyMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (AttestationPolicy). +func (m *AttestationPolicyMutation) 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 *AttestationPolicyMutation) Fields() []string { + fields := make([]string, 0, 1) + if m.name != nil { + fields = append(fields, attestationpolicy.FieldName) + } + 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 *AttestationPolicyMutation) Field(name string) (ent.Value, bool) { + switch name { + case attestationpolicy.FieldName: + return m.Name() + } + 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 *AttestationPolicyMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case attestationpolicy.FieldName: + return m.OldName(ctx) + } + return nil, fmt.Errorf("unknown AttestationPolicy 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 *AttestationPolicyMutation) SetField(name string, value ent.Value) error { + switch name { + case attestationpolicy.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + } + return fmt.Errorf("unknown AttestationPolicy field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *AttestationPolicyMutation) 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 *AttestationPolicyMutation) 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 *AttestationPolicyMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown AttestationPolicy numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *AttestationPolicyMutation) ClearedFields() []string { + return nil +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *AttestationPolicyMutation) 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 *AttestationPolicyMutation) ClearField(name string) error { + return fmt.Errorf("unknown AttestationPolicy 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 *AttestationPolicyMutation) ResetField(name string) error { + switch name { + case attestationpolicy.FieldName: + m.ResetName() + return nil + } + return fmt.Errorf("unknown AttestationPolicy field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *AttestationPolicyMutation) AddedEdges() []string { + edges := make([]string, 0, 1) + if m.statement != nil { + edges = append(edges, attestationpolicy.EdgeStatement) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *AttestationPolicyMutation) AddedIDs(name string) []ent.Value { + switch name { + case attestationpolicy.EdgeStatement: + if id := m.statement; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *AttestationPolicyMutation) 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 *AttestationPolicyMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *AttestationPolicyMutation) ClearedEdges() []string { + edges := make([]string, 0, 1) + if m.clearedstatement { + edges = append(edges, attestationpolicy.EdgeStatement) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *AttestationPolicyMutation) EdgeCleared(name string) bool { + switch name { + case attestationpolicy.EdgeStatement: + return m.clearedstatement + } + 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 *AttestationPolicyMutation) ClearEdge(name string) error { + switch name { + case attestationpolicy.EdgeStatement: + m.ClearStatement() + return nil + } + return fmt.Errorf("unknown AttestationPolicy 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 *AttestationPolicyMutation) ResetEdge(name string) error { + switch name { + case attestationpolicy.EdgeStatement: + m.ResetStatement() + return nil + } + return fmt.Errorf("unknown AttestationPolicy edge %s", name) +} + // DsseMutation represents an operation that mutates the Dsse nodes in the graph. type DsseMutation struct { config @@ -2519,6 +2914,8 @@ type StatementMutation struct { subjects map[int]struct{} removedsubjects map[int]struct{} clearedsubjects bool + policy *int + clearedpolicy bool attestation_collections *int clearedattestation_collections bool dsse map[int]struct{} @@ -2717,6 +3114,45 @@ func (m *StatementMutation) ResetSubjects() { m.removedsubjects = nil } +// SetPolicyID sets the "policy" edge to the AttestationPolicy entity by id. +func (m *StatementMutation) SetPolicyID(id int) { + m.policy = &id +} + +// ClearPolicy clears the "policy" edge to the AttestationPolicy entity. +func (m *StatementMutation) ClearPolicy() { + m.clearedpolicy = true +} + +// PolicyCleared reports if the "policy" edge to the AttestationPolicy entity was cleared. +func (m *StatementMutation) PolicyCleared() bool { + return m.clearedpolicy +} + +// PolicyID returns the "policy" edge ID in the mutation. +func (m *StatementMutation) PolicyID() (id int, exists bool) { + if m.policy != nil { + return *m.policy, true + } + return +} + +// PolicyIDs returns the "policy" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// PolicyID instead. It exists only for internal usage by the builders. +func (m *StatementMutation) PolicyIDs() (ids []int) { + if id := m.policy; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetPolicy resets all changes to the "policy" edge. +func (m *StatementMutation) ResetPolicy() { + m.policy = nil + m.clearedpolicy = false +} + // SetAttestationCollectionsID sets the "attestation_collections" edge to the AttestationCollection entity by id. func (m *StatementMutation) SetAttestationCollectionsID(id int) { m.attestation_collections = &id @@ -2943,10 +3379,13 @@ func (m *StatementMutation) ResetField(name string) error { // AddedEdges returns all edge names that were set/added in this mutation. func (m *StatementMutation) AddedEdges() []string { - edges := make([]string, 0, 3) + edges := make([]string, 0, 4) if m.subjects != nil { edges = append(edges, statement.EdgeSubjects) } + if m.policy != nil { + edges = append(edges, statement.EdgePolicy) + } if m.attestation_collections != nil { edges = append(edges, statement.EdgeAttestationCollections) } @@ -2966,6 +3405,10 @@ func (m *StatementMutation) AddedIDs(name string) []ent.Value { ids = append(ids, id) } return ids + case statement.EdgePolicy: + if id := m.policy; id != nil { + return []ent.Value{*id} + } case statement.EdgeAttestationCollections: if id := m.attestation_collections; id != nil { return []ent.Value{*id} @@ -2982,7 +3425,7 @@ func (m *StatementMutation) AddedIDs(name string) []ent.Value { // RemovedEdges returns all edge names that were removed in this mutation. func (m *StatementMutation) RemovedEdges() []string { - edges := make([]string, 0, 3) + edges := make([]string, 0, 4) if m.removedsubjects != nil { edges = append(edges, statement.EdgeSubjects) } @@ -3014,10 +3457,13 @@ func (m *StatementMutation) RemovedIDs(name string) []ent.Value { // ClearedEdges returns all edge names that were cleared in this mutation. func (m *StatementMutation) ClearedEdges() []string { - edges := make([]string, 0, 3) + edges := make([]string, 0, 4) if m.clearedsubjects { edges = append(edges, statement.EdgeSubjects) } + if m.clearedpolicy { + edges = append(edges, statement.EdgePolicy) + } if m.clearedattestation_collections { edges = append(edges, statement.EdgeAttestationCollections) } @@ -3033,6 +3479,8 @@ func (m *StatementMutation) EdgeCleared(name string) bool { switch name { case statement.EdgeSubjects: return m.clearedsubjects + case statement.EdgePolicy: + return m.clearedpolicy case statement.EdgeAttestationCollections: return m.clearedattestation_collections case statement.EdgeDsse: @@ -3045,6 +3493,9 @@ func (m *StatementMutation) EdgeCleared(name string) bool { // if that edge is not defined in the schema. func (m *StatementMutation) ClearEdge(name string) error { switch name { + case statement.EdgePolicy: + m.ClearPolicy() + return nil case statement.EdgeAttestationCollections: m.ClearAttestationCollections() return nil @@ -3059,6 +3510,9 @@ func (m *StatementMutation) ResetEdge(name string) error { case statement.EdgeSubjects: m.ResetSubjects() return nil + case statement.EdgePolicy: + m.ResetPolicy() + return nil case statement.EdgeAttestationCollections: m.ResetAttestationCollections() return nil diff --git a/ent/payloaddigest.go b/ent/payloaddigest.go index a8561e94..6e07080b 100644 --- a/ent/payloaddigest.go +++ b/ent/payloaddigest.go @@ -42,12 +42,10 @@ type PayloadDigestEdges struct { // DsseOrErr returns the Dsse value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. func (e PayloadDigestEdges) DsseOrErr() (*Dsse, error) { - if e.loadedTypes[0] { - if e.Dsse == nil { - // Edge was loaded but was not found. - return nil, &NotFoundError{label: dsse.Label} - } + if e.Dsse != nil { return e.Dsse, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: dsse.Label} } return nil, &NotLoadedError{edge: "dsse"} } diff --git a/ent/predicate/predicate.go b/ent/predicate/predicate.go index 38e2e345..3306c827 100644 --- a/ent/predicate/predicate.go +++ b/ent/predicate/predicate.go @@ -12,6 +12,9 @@ type Attestation func(*sql.Selector) // AttestationCollection is the predicate function for attestationcollection builders. type AttestationCollection func(*sql.Selector) +// AttestationPolicy is the predicate function for attestationpolicy builders. +type AttestationPolicy func(*sql.Selector) + // Dsse is the predicate function for dsse builders. type Dsse func(*sql.Selector) diff --git a/ent/runtime.go b/ent/runtime.go index daf8610c..06f23d34 100644 --- a/ent/runtime.go +++ b/ent/runtime.go @@ -5,6 +5,7 @@ package ent import ( "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/dsse" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/schema" @@ -30,6 +31,12 @@ func init() { attestationcollectionDescName := attestationcollectionFields[0].Descriptor() // attestationcollection.NameValidator is a validator for the "name" field. It is called by the builders before save. attestationcollection.NameValidator = attestationcollectionDescName.Validators[0].(func(string) error) + attestationpolicyFields := schema.AttestationPolicy{}.Fields() + _ = attestationpolicyFields + // attestationpolicyDescName is the schema descriptor for name field. + attestationpolicyDescName := attestationpolicyFields[0].Descriptor() + // attestationpolicy.NameValidator is a validator for the "name" field. It is called by the builders before save. + attestationpolicy.NameValidator = attestationpolicyDescName.Validators[0].(func(string) error) dsseFields := schema.Dsse{}.Fields() _ = dsseFields // dsseDescGitoidSha256 is the schema descriptor for gitoid_sha256 field. diff --git a/ent/runtime/runtime.go b/ent/runtime/runtime.go index 3cd5c9cf..e1ed00f3 100644 --- a/ent/runtime/runtime.go +++ b/ent/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in github.com/in-toto/archivista/ent/runtime.go const ( - Version = "v0.12.5" // Version of ent codegen. - Sum = "h1:KREM5E4CSoej4zeGa88Ou/gfturAnpUv0mzAjch1sj4=" // Sum of ent codegen. + Version = "v0.13.1" // Version of ent codegen. + Sum = "h1:uD8QwN1h6SNphdCCzmkMN3feSUzNnVvV/WIkHKMbzOE=" // Sum of ent codegen. ) diff --git a/ent/schema/attestationpolicy.go b/ent/schema/attestationpolicy.go new file mode 100644 index 00000000..ba0eaa02 --- /dev/null +++ b/ent/schema/attestationpolicy.go @@ -0,0 +1,56 @@ +// Copyright 2024 The Archivista Contributors +// +// 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. + +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" +) + +// Attestation represents an attestation from a witness attestation collection +type AttestationPolicy struct { + ent.Schema +} + +func (AttestationPolicy) Fields() []ent.Field { + return []ent.Field{ + field.String("name").NotEmpty(), + } +} + +// Edges of the AttestationPolicy. +func (AttestationPolicy) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("statement", Statement.Type). + Ref("policy").Unique(), + } +} + +func (AttestationPolicy) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("name"), + } +} + +func (AttestationPolicy) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.RelayConnection(), + entgql.QueryField(), + } +} diff --git a/ent/schema/statement.go b/ent/schema/statement.go index cf62f984..47cea537 100644 --- a/ent/schema/statement.go +++ b/ent/schema/statement.go @@ -38,6 +38,7 @@ func (Statement) Fields() []ent.Field { func (Statement) Edges() []ent.Edge { return []ent.Edge{ edge.To("subjects", Subject.Type).Annotations(entgql.RelayConnection()), + edge.To("policy", AttestationPolicy.Type).Unique(), edge.To("attestation_collections", AttestationCollection.Type).Unique(), edge.From("dsse", Dsse.Type).Ref("statement"), diff --git a/ent/signature.go b/ent/signature.go index 32e20078..46b0aeca 100644 --- a/ent/signature.go +++ b/ent/signature.go @@ -46,12 +46,10 @@ type SignatureEdges struct { // DsseOrErr returns the Dsse value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. func (e SignatureEdges) DsseOrErr() (*Dsse, error) { - if e.loadedTypes[0] { - if e.Dsse == nil { - // Edge was loaded but was not found. - return nil, &NotFoundError{label: dsse.Label} - } + if e.Dsse != nil { return e.Dsse, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: dsse.Label} } return nil, &NotLoadedError{edge: "dsse"} } diff --git a/ent/statement.go b/ent/statement.go index 1bef5a15..f59a0d80 100644 --- a/ent/statement.go +++ b/ent/statement.go @@ -9,6 +9,7 @@ import ( "entgo.io/ent" "entgo.io/ent/dialect/sql" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/statement" ) @@ -29,15 +30,17 @@ type Statement struct { type StatementEdges struct { // Subjects holds the value of the subjects edge. Subjects []*Subject `json:"subjects,omitempty"` + // Policy holds the value of the policy edge. + Policy *AttestationPolicy `json:"policy,omitempty"` // AttestationCollections holds the value of the attestation_collections edge. AttestationCollections *AttestationCollection `json:"attestation_collections,omitempty"` // Dsse holds the value of the dsse edge. Dsse []*Dsse `json:"dsse,omitempty"` // loadedTypes holds the information for reporting if a // type was loaded (or requested) in eager-loading or not. - loadedTypes [3]bool + loadedTypes [4]bool // totalCount holds the count of the edges above. - totalCount [3]map[string]int + totalCount [4]map[string]int namedSubjects map[string][]*Subject namedDsse map[string][]*Dsse @@ -52,15 +55,24 @@ func (e StatementEdges) SubjectsOrErr() ([]*Subject, error) { return nil, &NotLoadedError{edge: "subjects"} } +// PolicyOrErr returns the Policy value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e StatementEdges) PolicyOrErr() (*AttestationPolicy, error) { + if e.Policy != nil { + return e.Policy, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: attestationpolicy.Label} + } + return nil, &NotLoadedError{edge: "policy"} +} + // AttestationCollectionsOrErr returns the AttestationCollections value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. func (e StatementEdges) AttestationCollectionsOrErr() (*AttestationCollection, error) { - if e.loadedTypes[1] { - if e.AttestationCollections == nil { - // Edge was loaded but was not found. - return nil, &NotFoundError{label: attestationcollection.Label} - } + if e.AttestationCollections != nil { return e.AttestationCollections, nil + } else if e.loadedTypes[2] { + return nil, &NotFoundError{label: attestationcollection.Label} } return nil, &NotLoadedError{edge: "attestation_collections"} } @@ -68,7 +80,7 @@ func (e StatementEdges) AttestationCollectionsOrErr() (*AttestationCollection, e // DsseOrErr returns the Dsse value or an error if the edge // was not loaded in eager-loading. func (e StatementEdges) DsseOrErr() ([]*Dsse, error) { - if e.loadedTypes[2] { + if e.loadedTypes[3] { return e.Dsse, nil } return nil, &NotLoadedError{edge: "dsse"} @@ -128,6 +140,11 @@ func (s *Statement) QuerySubjects() *SubjectQuery { return NewStatementClient(s.config).QuerySubjects(s) } +// QueryPolicy queries the "policy" edge of the Statement entity. +func (s *Statement) QueryPolicy() *AttestationPolicyQuery { + return NewStatementClient(s.config).QueryPolicy(s) +} + // QueryAttestationCollections queries the "attestation_collections" edge of the Statement entity. func (s *Statement) QueryAttestationCollections() *AttestationCollectionQuery { return NewStatementClient(s.config).QueryAttestationCollections(s) diff --git a/ent/statement/statement.go b/ent/statement/statement.go index 82e86df0..97713e3c 100644 --- a/ent/statement/statement.go +++ b/ent/statement/statement.go @@ -16,6 +16,8 @@ const ( FieldPredicate = "predicate" // EdgeSubjects holds the string denoting the subjects edge name in mutations. EdgeSubjects = "subjects" + // EdgePolicy holds the string denoting the policy edge name in mutations. + EdgePolicy = "policy" // EdgeAttestationCollections holds the string denoting the attestation_collections edge name in mutations. EdgeAttestationCollections = "attestation_collections" // EdgeDsse holds the string denoting the dsse edge name in mutations. @@ -29,6 +31,13 @@ const ( SubjectsInverseTable = "subjects" // SubjectsColumn is the table column denoting the subjects relation/edge. SubjectsColumn = "statement_subjects" + // PolicyTable is the table that holds the policy relation/edge. + PolicyTable = "attestation_policies" + // PolicyInverseTable is the table name for the AttestationPolicy entity. + // It exists in this package in order to avoid circular dependency with the "attestationpolicy" package. + PolicyInverseTable = "attestation_policies" + // PolicyColumn is the table column denoting the policy relation/edge. + PolicyColumn = "statement_policy" // AttestationCollectionsTable is the table that holds the attestation_collections relation/edge. AttestationCollectionsTable = "attestation_collections" // AttestationCollectionsInverseTable is the table name for the AttestationCollection entity. @@ -93,6 +102,13 @@ func BySubjects(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { } } +// ByPolicyField orders the results by policy field. +func ByPolicyField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newPolicyStep(), sql.OrderByField(field, opts...)) + } +} + // ByAttestationCollectionsField orders the results by attestation_collections field. func ByAttestationCollectionsField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { @@ -120,6 +136,13 @@ func newSubjectsStep() *sqlgraph.Step { sqlgraph.Edge(sqlgraph.O2M, false, SubjectsTable, SubjectsColumn), ) } +func newPolicyStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(PolicyInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, PolicyTable, PolicyColumn), + ) +} func newAttestationCollectionsStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), diff --git a/ent/statement/where.go b/ent/statement/where.go index d0438166..50bcb781 100644 --- a/ent/statement/where.go +++ b/ent/statement/where.go @@ -146,6 +146,29 @@ func HasSubjectsWith(preds ...predicate.Subject) predicate.Statement { }) } +// HasPolicy applies the HasEdge predicate on the "policy" edge. +func HasPolicy() predicate.Statement { + return predicate.Statement(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, PolicyTable, PolicyColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasPolicyWith applies the HasEdge predicate on the "policy" edge with a given conditions (other predicates). +func HasPolicyWith(preds ...predicate.AttestationPolicy) predicate.Statement { + return predicate.Statement(func(s *sql.Selector) { + step := newPolicyStep() + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + // HasAttestationCollections applies the HasEdge predicate on the "attestation_collections" edge. func HasAttestationCollections() predicate.Statement { return predicate.Statement(func(s *sql.Selector) { diff --git a/ent/statement_create.go b/ent/statement_create.go index a57fbd75..5e3b086f 100644 --- a/ent/statement_create.go +++ b/ent/statement_create.go @@ -10,6 +10,7 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/dsse" "github.com/in-toto/archivista/ent/statement" "github.com/in-toto/archivista/ent/subject" @@ -43,6 +44,25 @@ func (sc *StatementCreate) AddSubjects(s ...*Subject) *StatementCreate { return sc.AddSubjectIDs(ids...) } +// SetPolicyID sets the "policy" edge to the AttestationPolicy entity by ID. +func (sc *StatementCreate) SetPolicyID(id int) *StatementCreate { + sc.mutation.SetPolicyID(id) + return sc +} + +// SetNillablePolicyID sets the "policy" edge to the AttestationPolicy entity by ID if the given value is not nil. +func (sc *StatementCreate) SetNillablePolicyID(id *int) *StatementCreate { + if id != nil { + sc = sc.SetPolicyID(*id) + } + return sc +} + +// SetPolicy sets the "policy" edge to the AttestationPolicy entity. +func (sc *StatementCreate) SetPolicy(a *AttestationPolicy) *StatementCreate { + return sc.SetPolicyID(a.ID) +} + // SetAttestationCollectionsID sets the "attestation_collections" edge to the AttestationCollection entity by ID. func (sc *StatementCreate) SetAttestationCollectionsID(id int) *StatementCreate { sc.mutation.SetAttestationCollectionsID(id) @@ -165,6 +185,22 @@ func (sc *StatementCreate) createSpec() (*Statement, *sqlgraph.CreateSpec) { } _spec.Edges = append(_spec.Edges, edge) } + if nodes := sc.mutation.PolicyIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: statement.PolicyTable, + Columns: []string{statement.PolicyColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(attestationpolicy.FieldID, field.TypeInt), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } if nodes := sc.mutation.AttestationCollectionsIDs(); len(nodes) > 0 { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2O, diff --git a/ent/statement_query.go b/ent/statement_query.go index d4db9395..160a2ac0 100644 --- a/ent/statement_query.go +++ b/ent/statement_query.go @@ -12,6 +12,7 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/dsse" "github.com/in-toto/archivista/ent/predicate" "github.com/in-toto/archivista/ent/statement" @@ -26,6 +27,7 @@ type StatementQuery struct { inters []Interceptor predicates []predicate.Statement withSubjects *SubjectQuery + withPolicy *AttestationPolicyQuery withAttestationCollections *AttestationCollectionQuery withDsse *DsseQuery modifiers []func(*sql.Selector) @@ -90,6 +92,28 @@ func (sq *StatementQuery) QuerySubjects() *SubjectQuery { return query } +// QueryPolicy chains the current query on the "policy" edge. +func (sq *StatementQuery) QueryPolicy() *AttestationPolicyQuery { + query := (&AttestationPolicyClient{config: sq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := sq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := sq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(statement.Table, statement.FieldID, selector), + sqlgraph.To(attestationpolicy.Table, attestationpolicy.FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, statement.PolicyTable, statement.PolicyColumn), + ) + fromU = sqlgraph.SetNeighbors(sq.driver.Dialect(), step) + return fromU, nil + } + return query +} + // QueryAttestationCollections chains the current query on the "attestation_collections" edge. func (sq *StatementQuery) QueryAttestationCollections() *AttestationCollectionQuery { query := (&AttestationCollectionClient{config: sq.config}).Query() @@ -327,6 +351,7 @@ func (sq *StatementQuery) Clone() *StatementQuery { inters: append([]Interceptor{}, sq.inters...), predicates: append([]predicate.Statement{}, sq.predicates...), withSubjects: sq.withSubjects.Clone(), + withPolicy: sq.withPolicy.Clone(), withAttestationCollections: sq.withAttestationCollections.Clone(), withDsse: sq.withDsse.Clone(), // clone intermediate query. @@ -346,6 +371,17 @@ func (sq *StatementQuery) WithSubjects(opts ...func(*SubjectQuery)) *StatementQu return sq } +// WithPolicy tells the query-builder to eager-load the nodes that are connected to +// the "policy" edge. The optional arguments are used to configure the query builder of the edge. +func (sq *StatementQuery) WithPolicy(opts ...func(*AttestationPolicyQuery)) *StatementQuery { + query := (&AttestationPolicyClient{config: sq.config}).Query() + for _, opt := range opts { + opt(query) + } + sq.withPolicy = query + return sq +} + // WithAttestationCollections tells the query-builder to eager-load the nodes that are connected to // the "attestation_collections" edge. The optional arguments are used to configure the query builder of the edge. func (sq *StatementQuery) WithAttestationCollections(opts ...func(*AttestationCollectionQuery)) *StatementQuery { @@ -446,8 +482,9 @@ func (sq *StatementQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*St var ( nodes = []*Statement{} _spec = sq.querySpec() - loadedTypes = [3]bool{ + loadedTypes = [4]bool{ sq.withSubjects != nil, + sq.withPolicy != nil, sq.withAttestationCollections != nil, sq.withDsse != nil, } @@ -480,6 +517,12 @@ func (sq *StatementQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*St return nil, err } } + if query := sq.withPolicy; query != nil { + if err := sq.loadPolicy(ctx, query, nodes, nil, + func(n *Statement, e *AttestationPolicy) { n.Edges.Policy = e }); err != nil { + return nil, err + } + } if query := sq.withAttestationCollections; query != nil { if err := sq.loadAttestationCollections(ctx, query, nodes, nil, func(n *Statement, e *AttestationCollection) { n.Edges.AttestationCollections = e }); err != nil { @@ -546,6 +589,34 @@ func (sq *StatementQuery) loadSubjects(ctx context.Context, query *SubjectQuery, } return nil } +func (sq *StatementQuery) loadPolicy(ctx context.Context, query *AttestationPolicyQuery, nodes []*Statement, init func(*Statement), assign func(*Statement, *AttestationPolicy)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[int]*Statement) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + } + query.withFKs = true + query.Where(predicate.AttestationPolicy(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(statement.PolicyColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.statement_policy + if fk == nil { + return fmt.Errorf(`foreign-key "statement_policy" is nil for node %v`, n.ID) + } + node, ok := nodeids[*fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "statement_policy" returned %v for node %v`, *fk, n.ID) + } + assign(node, n) + } + return nil +} func (sq *StatementQuery) loadAttestationCollections(ctx context.Context, query *AttestationCollectionQuery, nodes []*Statement, init func(*Statement), assign func(*Statement, *AttestationCollection)) error { fks := make([]driver.Value, 0, len(nodes)) nodeids := make(map[int]*Statement) diff --git a/ent/statement_update.go b/ent/statement_update.go index 0a9fa805..befaba69 100644 --- a/ent/statement_update.go +++ b/ent/statement_update.go @@ -11,6 +11,7 @@ import ( "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/attestationpolicy" "github.com/in-toto/archivista/ent/dsse" "github.com/in-toto/archivista/ent/predicate" "github.com/in-toto/archivista/ent/statement" @@ -59,6 +60,25 @@ func (su *StatementUpdate) AddSubjects(s ...*Subject) *StatementUpdate { return su.AddSubjectIDs(ids...) } +// SetPolicyID sets the "policy" edge to the AttestationPolicy entity by ID. +func (su *StatementUpdate) SetPolicyID(id int) *StatementUpdate { + su.mutation.SetPolicyID(id) + return su +} + +// SetNillablePolicyID sets the "policy" edge to the AttestationPolicy entity by ID if the given value is not nil. +func (su *StatementUpdate) SetNillablePolicyID(id *int) *StatementUpdate { + if id != nil { + su = su.SetPolicyID(*id) + } + return su +} + +// SetPolicy sets the "policy" edge to the AttestationPolicy entity. +func (su *StatementUpdate) SetPolicy(a *AttestationPolicy) *StatementUpdate { + return su.SetPolicyID(a.ID) +} + // SetAttestationCollectionsID sets the "attestation_collections" edge to the AttestationCollection entity by ID. func (su *StatementUpdate) SetAttestationCollectionsID(id int) *StatementUpdate { su.mutation.SetAttestationCollectionsID(id) @@ -119,6 +139,12 @@ func (su *StatementUpdate) RemoveSubjects(s ...*Subject) *StatementUpdate { return su.RemoveSubjectIDs(ids...) } +// ClearPolicy clears the "policy" edge to the AttestationPolicy entity. +func (su *StatementUpdate) ClearPolicy() *StatementUpdate { + su.mutation.ClearPolicy() + return su +} + // ClearAttestationCollections clears the "attestation_collections" edge to the AttestationCollection entity. func (su *StatementUpdate) ClearAttestationCollections() *StatementUpdate { su.mutation.ClearAttestationCollections() @@ -243,6 +269,35 @@ func (su *StatementUpdate) sqlSave(ctx context.Context) (n int, err error) { } _spec.Edges.Add = append(_spec.Edges.Add, edge) } + if su.mutation.PolicyCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: statement.PolicyTable, + Columns: []string{statement.PolicyColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(attestationpolicy.FieldID, field.TypeInt), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := su.mutation.PolicyIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: statement.PolicyTable, + Columns: []string{statement.PolicyColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(attestationpolicy.FieldID, field.TypeInt), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } if su.mutation.AttestationCollectionsCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2O, @@ -366,6 +421,25 @@ func (suo *StatementUpdateOne) AddSubjects(s ...*Subject) *StatementUpdateOne { return suo.AddSubjectIDs(ids...) } +// SetPolicyID sets the "policy" edge to the AttestationPolicy entity by ID. +func (suo *StatementUpdateOne) SetPolicyID(id int) *StatementUpdateOne { + suo.mutation.SetPolicyID(id) + return suo +} + +// SetNillablePolicyID sets the "policy" edge to the AttestationPolicy entity by ID if the given value is not nil. +func (suo *StatementUpdateOne) SetNillablePolicyID(id *int) *StatementUpdateOne { + if id != nil { + suo = suo.SetPolicyID(*id) + } + return suo +} + +// SetPolicy sets the "policy" edge to the AttestationPolicy entity. +func (suo *StatementUpdateOne) SetPolicy(a *AttestationPolicy) *StatementUpdateOne { + return suo.SetPolicyID(a.ID) +} + // SetAttestationCollectionsID sets the "attestation_collections" edge to the AttestationCollection entity by ID. func (suo *StatementUpdateOne) SetAttestationCollectionsID(id int) *StatementUpdateOne { suo.mutation.SetAttestationCollectionsID(id) @@ -426,6 +500,12 @@ func (suo *StatementUpdateOne) RemoveSubjects(s ...*Subject) *StatementUpdateOne return suo.RemoveSubjectIDs(ids...) } +// ClearPolicy clears the "policy" edge to the AttestationPolicy entity. +func (suo *StatementUpdateOne) ClearPolicy() *StatementUpdateOne { + suo.mutation.ClearPolicy() + return suo +} + // ClearAttestationCollections clears the "attestation_collections" edge to the AttestationCollection entity. func (suo *StatementUpdateOne) ClearAttestationCollections() *StatementUpdateOne { suo.mutation.ClearAttestationCollections() @@ -580,6 +660,35 @@ func (suo *StatementUpdateOne) sqlSave(ctx context.Context) (_node *Statement, e } _spec.Edges.Add = append(_spec.Edges.Add, edge) } + if suo.mutation.PolicyCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: statement.PolicyTable, + Columns: []string{statement.PolicyColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(attestationpolicy.FieldID, field.TypeInt), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := suo.mutation.PolicyIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: statement.PolicyTable, + Columns: []string{statement.PolicyColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(attestationpolicy.FieldID, field.TypeInt), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } if suo.mutation.AttestationCollectionsCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2O, diff --git a/ent/subject.go b/ent/subject.go index 9a84ff5e..cfc92bca 100644 --- a/ent/subject.go +++ b/ent/subject.go @@ -53,12 +53,10 @@ func (e SubjectEdges) SubjectDigestsOrErr() ([]*SubjectDigest, error) { // StatementOrErr returns the Statement value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. func (e SubjectEdges) StatementOrErr() (*Statement, error) { - if e.loadedTypes[1] { - if e.Statement == nil { - // Edge was loaded but was not found. - return nil, &NotFoundError{label: statement.Label} - } + if e.Statement != nil { return e.Statement, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: statement.Label} } return nil, &NotLoadedError{edge: "statement"} } diff --git a/ent/subjectdigest.go b/ent/subjectdigest.go index 00fbae68..0c778149 100644 --- a/ent/subjectdigest.go +++ b/ent/subjectdigest.go @@ -42,12 +42,10 @@ type SubjectDigestEdges struct { // SubjectOrErr returns the Subject value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. func (e SubjectDigestEdges) SubjectOrErr() (*Subject, error) { - if e.loadedTypes[0] { - if e.Subject == nil { - // Edge was loaded but was not found. - return nil, &NotFoundError{label: subject.Label} - } + if e.Subject != nil { return e.Subject, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: subject.Label} } return nil, &NotLoadedError{edge: "subject"} } diff --git a/ent/timestamp.go b/ent/timestamp.go index fca13d63..2aa595be 100644 --- a/ent/timestamp.go +++ b/ent/timestamp.go @@ -43,12 +43,10 @@ type TimestampEdges struct { // SignatureOrErr returns the Signature value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. func (e TimestampEdges) SignatureOrErr() (*Signature, error) { - if e.loadedTypes[0] { - if e.Signature == nil { - // Edge was loaded but was not found. - return nil, &NotFoundError{label: signature.Label} - } + if e.Signature != nil { return e.Signature, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: signature.Label} } return nil, &NotLoadedError{edge: "signature"} } diff --git a/ent/tx.go b/ent/tx.go index e7ea4609..8a1f4cd8 100644 --- a/ent/tx.go +++ b/ent/tx.go @@ -16,6 +16,8 @@ type Tx struct { Attestation *AttestationClient // AttestationCollection is the client for interacting with the AttestationCollection builders. AttestationCollection *AttestationCollectionClient + // AttestationPolicy is the client for interacting with the AttestationPolicy builders. + AttestationPolicy *AttestationPolicyClient // Dsse is the client for interacting with the Dsse builders. Dsse *DsseClient // PayloadDigest is the client for interacting with the PayloadDigest builders. @@ -163,6 +165,7 @@ func (tx *Tx) Client() *Client { func (tx *Tx) init() { tx.Attestation = NewAttestationClient(tx.config) tx.AttestationCollection = NewAttestationCollectionClient(tx.config) + tx.AttestationPolicy = NewAttestationPolicyClient(tx.config) tx.Dsse = NewDsseClient(tx.config) tx.PayloadDigest = NewPayloadDigestClient(tx.config) tx.Signature = NewSignatureClient(tx.config) diff --git a/generated.go b/generated.go index b77e36d2..a3187b6d 100644 --- a/generated.go +++ b/generated.go @@ -61,6 +61,23 @@ type ComplexityRoot struct { Statement func(childComplexity int) int } + AttestationPolicy struct { + ID func(childComplexity int) int + Name func(childComplexity int) int + Statement func(childComplexity int) int + } + + AttestationPolicyConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + AttestationPolicyEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + Dsse struct { GitoidSha256 func(childComplexity int) int ID func(childComplexity int) int @@ -96,10 +113,11 @@ type ComplexityRoot struct { } Query struct { - Dsses func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.DsseWhereInput) int - Node func(childComplexity int, id int) int - Nodes func(childComplexity int, ids []int) int - Subjects func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.SubjectWhereInput) int + AttestationPolicies func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.AttestationPolicyWhereInput) int + Dsses func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.DsseWhereInput) int + Node func(childComplexity int, id int) int + Nodes func(childComplexity int, ids []int) int + Subjects func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.SubjectWhereInput) int } Signature struct { @@ -114,6 +132,7 @@ type ComplexityRoot struct { AttestationCollections func(childComplexity int) int Dsse func(childComplexity int) int ID func(childComplexity int) int + Policy func(childComplexity int) int Predicate func(childComplexity int) int Subjects func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.SubjectWhereInput) int } @@ -154,6 +173,7 @@ type ComplexityRoot struct { type QueryResolver interface { Node(ctx context.Context, id int) (ent.Noder, error) Nodes(ctx context.Context, ids []int) ([]ent.Noder, error) + AttestationPolicies(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.AttestationPolicyWhereInput) (*ent.AttestationPolicyConnection, error) Dsses(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.DsseWhereInput) (*ent.DsseConnection, error) Subjects(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.SubjectWhereInput) (*ent.SubjectConnection, error) } @@ -226,6 +246,62 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.AttestationCollection.Statement(childComplexity), true + case "AttestationPolicy.id": + if e.complexity.AttestationPolicy.ID == nil { + break + } + + return e.complexity.AttestationPolicy.ID(childComplexity), true + + case "AttestationPolicy.name": + if e.complexity.AttestationPolicy.Name == nil { + break + } + + return e.complexity.AttestationPolicy.Name(childComplexity), true + + case "AttestationPolicy.statement": + if e.complexity.AttestationPolicy.Statement == nil { + break + } + + return e.complexity.AttestationPolicy.Statement(childComplexity), true + + case "AttestationPolicyConnection.edges": + if e.complexity.AttestationPolicyConnection.Edges == nil { + break + } + + return e.complexity.AttestationPolicyConnection.Edges(childComplexity), true + + case "AttestationPolicyConnection.pageInfo": + if e.complexity.AttestationPolicyConnection.PageInfo == nil { + break + } + + return e.complexity.AttestationPolicyConnection.PageInfo(childComplexity), true + + case "AttestationPolicyConnection.totalCount": + if e.complexity.AttestationPolicyConnection.TotalCount == nil { + break + } + + return e.complexity.AttestationPolicyConnection.TotalCount(childComplexity), true + + case "AttestationPolicyEdge.cursor": + if e.complexity.AttestationPolicyEdge.Cursor == nil { + break + } + + return e.complexity.AttestationPolicyEdge.Cursor(childComplexity), true + + case "AttestationPolicyEdge.node": + if e.complexity.AttestationPolicyEdge.Node == nil { + break + } + + return e.complexity.AttestationPolicyEdge.Node(childComplexity), true + case "Dsse.gitoidSha256": if e.complexity.Dsse.GitoidSha256 == nil { break @@ -359,6 +435,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.PayloadDigest.Value(childComplexity), true + case "Query.attestationPolicies": + if e.complexity.Query.AttestationPolicies == nil { + break + } + + args, err := ec.field_Query_attestationPolicies_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.AttestationPolicies(childComplexity, args["after"].(*entgql.Cursor[int]), args["first"].(*int), args["before"].(*entgql.Cursor[int]), args["last"].(*int), args["where"].(*ent.AttestationPolicyWhereInput)), true + case "Query.dsses": if e.complexity.Query.Dsses == nil { break @@ -463,6 +551,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Statement.ID(childComplexity), true + case "Statement.policy": + if e.complexity.Statement.Policy == nil { + break + } + + return e.complexity.Statement.Policy(childComplexity), true + case "Statement.predicate": if e.complexity.Statement.Predicate == nil { break @@ -610,6 +705,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec := executionContext{rc, e, 0, 0, make(chan graphql.DeferredResult)} inputUnmarshalMap := graphql.BuildUnmarshalerMap( ec.unmarshalInputAttestationCollectionWhereInput, + ec.unmarshalInputAttestationPolicyWhereInput, ec.unmarshalInputAttestationWhereInput, ec.unmarshalInputDsseWhereInput, ec.unmarshalInputPayloadDigestWhereInput, @@ -735,6 +831,57 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs return args, nil } +func (ec *executionContext) field_Query_attestationPolicies_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[int] + 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[int] + 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 *ent.AttestationPolicyWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOAttestationPolicyWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + func (ec *executionContext) field_Query_dsses_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -777,7 +924,7 @@ func (ec *executionContext) field_Query_dsses_args(ctx context.Context, rawArgs var arg4 *ent.DsseWhereInput if tmp, ok := rawArgs["where"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg4, err = ec.unmarshalODsseWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseWhereInput(ctx, tmp) + arg4, err = ec.unmarshalODsseWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInput(ctx, tmp) if err != nil { return nil, err } @@ -858,7 +1005,7 @@ func (ec *executionContext) field_Query_subjects_args(ctx context.Context, rawAr var arg4 *ent.SubjectWhereInput if tmp, ok := rawArgs["where"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg4, err = ec.unmarshalOSubjectWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectWhereInput(ctx, tmp) + arg4, err = ec.unmarshalOSubjectWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectWhereInput(ctx, tmp) if err != nil { return nil, err } @@ -909,7 +1056,7 @@ func (ec *executionContext) field_Statement_subjects_args(ctx context.Context, r var arg4 *ent.SubjectWhereInput if tmp, ok := rawArgs["where"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg4, err = ec.unmarshalOSubjectWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectWhereInput(ctx, tmp) + arg4, err = ec.unmarshalOSubjectWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectWhereInput(ctx, tmp) if err != nil { return nil, err } @@ -1072,7 +1219,7 @@ func (ec *executionContext) _Attestation_attestationCollection(ctx context.Conte } res := resTmp.(*ent.AttestationCollection) fc.Result = res - return ec.marshalNAttestationCollection2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollection(ctx, field.Selections, res) + return ec.marshalNAttestationCollection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollection(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Attestation_attestationCollection(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -1211,7 +1358,7 @@ func (ec *executionContext) _AttestationCollection_attestations(ctx context.Cont } res := resTmp.([]*ent.Attestation) fc.Result = res - return ec.marshalOAttestation2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationᚄ(ctx, field.Selections, res) + return ec.marshalOAttestation2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationᚄ(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_AttestationCollection_attestations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -1263,7 +1410,7 @@ func (ec *executionContext) _AttestationCollection_statement(ctx context.Context } res := resTmp.(*ent.Statement) fc.Result = res - return ec.marshalNStatement2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatement(ctx, field.Selections, res) + return ec.marshalNStatement2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatement(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_AttestationCollection_statement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -1280,6 +1427,8 @@ func (ec *executionContext) fieldContext_AttestationCollection_statement(ctx con return ec.fieldContext_Statement_predicate(ctx, field) case "subjects": return ec.fieldContext_Statement_subjects(ctx, field) + case "policy": + return ec.fieldContext_Statement_policy(ctx, field) case "attestationCollections": return ec.fieldContext_Statement_attestationCollections(ctx, field) case "dsse": @@ -1291,8 +1440,8 @@ func (ec *executionContext) fieldContext_AttestationCollection_statement(ctx con return fc, nil } -func (ec *executionContext) _Dsse_id(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dsse_id(ctx, field) +func (ec *executionContext) _AttestationPolicy_id(ctx context.Context, field graphql.CollectedField, obj *ent.AttestationPolicy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AttestationPolicy_id(ctx, field) if err != nil { return graphql.Null } @@ -1322,9 +1471,9 @@ func (ec *executionContext) _Dsse_id(ctx context.Context, field graphql.Collecte return ec.marshalNID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dsse_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AttestationPolicy_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dsse", + Object: "AttestationPolicy", Field: field, IsMethod: false, IsResolver: false, @@ -1335,8 +1484,8 @@ func (ec *executionContext) fieldContext_Dsse_id(ctx context.Context, field grap return fc, nil } -func (ec *executionContext) _Dsse_gitoidSha256(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dsse_gitoidSha256(ctx, field) +func (ec *executionContext) _AttestationPolicy_name(ctx context.Context, field graphql.CollectedField, obj *ent.AttestationPolicy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AttestationPolicy_name(ctx, field) if err != nil { return graphql.Null } @@ -1349,7 +1498,7 @@ func (ec *executionContext) _Dsse_gitoidSha256(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.GitoidSha256, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -1366,9 +1515,9 @@ func (ec *executionContext) _Dsse_gitoidSha256(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dsse_gitoidSha256(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AttestationPolicy_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dsse", + Object: "AttestationPolicy", Field: field, IsMethod: false, IsResolver: false, @@ -1379,8 +1528,8 @@ func (ec *executionContext) fieldContext_Dsse_gitoidSha256(ctx context.Context, return fc, nil } -func (ec *executionContext) _Dsse_payloadType(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dsse_payloadType(ctx, field) +func (ec *executionContext) _AttestationPolicy_statement(ctx context.Context, field graphql.CollectedField, obj *ent.AttestationPolicy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AttestationPolicy_statement(ctx, field) if err != nil { return graphql.Null } @@ -1393,38 +1542,49 @@ func (ec *executionContext) _Dsse_payloadType(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.PayloadType, nil + return obj.Statement(ctx) }) 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.(*ent.Statement) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOStatement2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatement(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dsse_payloadType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AttestationPolicy_statement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dsse", + Object: "AttestationPolicy", 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 "id": + return ec.fieldContext_Statement_id(ctx, field) + case "predicate": + return ec.fieldContext_Statement_predicate(ctx, field) + case "subjects": + return ec.fieldContext_Statement_subjects(ctx, field) + case "policy": + return ec.fieldContext_Statement_policy(ctx, field) + case "attestationCollections": + return ec.fieldContext_Statement_attestationCollections(ctx, field) + case "dsse": + return ec.fieldContext_Statement_dsse(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Statement", field.Name) }, } return fc, nil } -func (ec *executionContext) _Dsse_statement(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dsse_statement(ctx, field) +func (ec *executionContext) _AttestationPolicyConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.AttestationPolicyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AttestationPolicyConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -1437,7 +1597,7 @@ func (ec *executionContext) _Dsse_statement(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 obj.Statement(ctx) + return obj.Edges, nil }) if err != nil { ec.Error(ctx, err) @@ -1446,38 +1606,32 @@ func (ec *executionContext) _Dsse_statement(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.Statement) + res := resTmp.([]*ent.AttestationPolicyEdge) fc.Result = res - return ec.marshalOStatement2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatement(ctx, field.Selections, res) + return ec.marshalOAttestationPolicyEdge2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dsse_statement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AttestationPolicyConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dsse", + Object: "AttestationPolicyConnection", 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_Statement_id(ctx, field) - case "predicate": - return ec.fieldContext_Statement_predicate(ctx, field) - case "subjects": - return ec.fieldContext_Statement_subjects(ctx, field) - case "attestationCollections": - return ec.fieldContext_Statement_attestationCollections(ctx, field) - case "dsse": - return ec.fieldContext_Statement_dsse(ctx, field) + case "node": + return ec.fieldContext_AttestationPolicyEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_AttestationPolicyEdge_cursor(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Statement", field.Name) + return nil, fmt.Errorf("no field named %q was found under type AttestationPolicyEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _Dsse_signatures(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dsse_signatures(ctx, field) +func (ec *executionContext) _AttestationPolicyConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.AttestationPolicyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AttestationPolicyConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -1490,47 +1644,48 @@ func (ec *executionContext) _Dsse_signatures(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.Signatures(ctx) + return obj.PageInfo, 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.([]*ent.Signature) + res := resTmp.(entgql.PageInfo[int]) fc.Result = res - return ec.marshalOSignature2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignatureᚄ(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dsse_signatures(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AttestationPolicyConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dsse", + Object: "AttestationPolicyConnection", 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_Signature_id(ctx, field) - case "keyID": - return ec.fieldContext_Signature_keyID(ctx, field) - case "signature": - return ec.fieldContext_Signature_signature(ctx, field) - case "dsse": - return ec.fieldContext_Signature_dsse(ctx, field) - case "timestamps": - return ec.fieldContext_Signature_timestamps(ctx, field) + 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 Signature", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) _Dsse_payloadDigests(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dsse_payloadDigests(ctx, field) +func (ec *executionContext) _AttestationPolicyConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.AttestationPolicyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AttestationPolicyConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -1543,45 +1698,38 @@ func (ec *executionContext) _Dsse_payloadDigests(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.PayloadDigests(ctx) + return obj.TotalCount, 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.([]*ent.PayloadDigest) + res := resTmp.(int) fc.Result = res - return ec.marshalOPayloadDigest2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigestᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dsse_payloadDigests(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AttestationPolicyConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dsse", + Object: "AttestationPolicyConnection", 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_PayloadDigest_id(ctx, field) - case "algorithm": - return ec.fieldContext_PayloadDigest_algorithm(ctx, field) - case "value": - return ec.fieldContext_PayloadDigest_value(ctx, field) - case "dsse": - return ec.fieldContext_PayloadDigest_dsse(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PayloadDigest", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _DsseConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.DsseConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DsseConnection_edges(ctx, field) +func (ec *executionContext) _AttestationPolicyEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.AttestationPolicyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AttestationPolicyEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -1594,7 +1742,7 @@ func (ec *executionContext) _DsseConnection_edges(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.Edges, nil + return obj.Node, nil }) if err != nil { ec.Error(ctx, err) @@ -1603,32 +1751,34 @@ func (ec *executionContext) _DsseConnection_edges(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.([]*ent.DsseEdge) + res := resTmp.(*ent.AttestationPolicy) fc.Result = res - return ec.marshalODsseEdge2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseEdge(ctx, field.Selections, res) + return ec.marshalOAttestationPolicy2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_DsseConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AttestationPolicyEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DsseConnection", + Object: "AttestationPolicyEdge", 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_DsseEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_DsseEdge_cursor(ctx, field) + case "id": + return ec.fieldContext_AttestationPolicy_id(ctx, field) + case "name": + return ec.fieldContext_AttestationPolicy_name(ctx, field) + case "statement": + return ec.fieldContext_AttestationPolicy_statement(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type DsseEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type AttestationPolicy", field.Name) }, } return fc, nil } -func (ec *executionContext) _DsseConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.DsseConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DsseConnection_pageInfo(ctx, field) +func (ec *executionContext) _AttestationPolicyEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.AttestationPolicyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AttestationPolicyEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -1641,7 +1791,7 @@ func (ec *executionContext) _DsseConnection_pageInfo(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.PageInfo, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -1653,25 +1803,407 @@ func (ec *executionContext) _DsseConnection_pageInfo(ctx context.Context, field } return graphql.Null } - res := resTmp.(entgql.PageInfo[int]) + res := resTmp.(entgql.Cursor[int]) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_DsseConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AttestationPolicyEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DsseConnection", + Object: "AttestationPolicyEdge", 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) + return nil, errors.New("field of type Cursor does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Dsse_id(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dsse_id(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.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.(int) + fc.Result = res + return ec.marshalNID2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dsse_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dsse", + 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) _Dsse_gitoidSha256(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dsse_gitoidSha256(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.GitoidSha256, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dsse_gitoidSha256(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dsse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Dsse_payloadType(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dsse_payloadType(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.PayloadType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dsse_payloadType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dsse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Dsse_statement(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dsse_statement(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.Statement(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*ent.Statement) + fc.Result = res + return ec.marshalOStatement2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatement(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dsse_statement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dsse", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Statement_id(ctx, field) + case "predicate": + return ec.fieldContext_Statement_predicate(ctx, field) + case "subjects": + return ec.fieldContext_Statement_subjects(ctx, field) + case "policy": + return ec.fieldContext_Statement_policy(ctx, field) + case "attestationCollections": + return ec.fieldContext_Statement_attestationCollections(ctx, field) + case "dsse": + return ec.fieldContext_Statement_dsse(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Statement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Dsse_signatures(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dsse_signatures(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.Signatures(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*ent.Signature) + fc.Result = res + return ec.marshalOSignature2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dsse_signatures(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dsse", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Signature_id(ctx, field) + case "keyID": + return ec.fieldContext_Signature_keyID(ctx, field) + case "signature": + return ec.fieldContext_Signature_signature(ctx, field) + case "dsse": + return ec.fieldContext_Signature_dsse(ctx, field) + case "timestamps": + return ec.fieldContext_Signature_timestamps(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Signature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Dsse_payloadDigests(ctx context.Context, field graphql.CollectedField, obj *ent.Dsse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dsse_payloadDigests(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.PayloadDigests(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*ent.PayloadDigest) + fc.Result = res + return ec.marshalOPayloadDigest2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dsse_payloadDigests(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dsse", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_PayloadDigest_id(ctx, field) + case "algorithm": + return ec.fieldContext_PayloadDigest_algorithm(ctx, field) + case "value": + return ec.fieldContext_PayloadDigest_value(ctx, field) + case "dsse": + return ec.fieldContext_PayloadDigest_dsse(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PayloadDigest", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DsseConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.DsseConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DsseConnection_edges(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.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*ent.DsseEdge) + fc.Result = res + return ec.marshalODsseEdge2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DsseConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DsseConnection", + 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_DsseEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_DsseEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DsseEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DsseConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.DsseConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DsseConnection_pageInfo(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.PageInfo, 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[int]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DsseConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DsseConnection", + 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) } @@ -1750,7 +2282,7 @@ func (ec *executionContext) _DsseEdge_node(ctx context.Context, field graphql.Co } res := resTmp.(*ent.Dsse) fc.Result = res - return ec.marshalODsse2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsse(ctx, field.Selections, res) + return ec.marshalODsse2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsse(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_DsseEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -2151,7 +2683,7 @@ func (ec *executionContext) _PayloadDigest_dsse(ctx context.Context, field graph } res := resTmp.(*ent.Dsse) fc.Result = res - return ec.marshalODsse2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsse(ctx, field.Selections, res) + return ec.marshalODsse2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsse(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_PayloadDigest_dsse(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -2206,7 +2738,7 @@ func (ec *executionContext) _Query_node(ctx context.Context, field graphql.Colle } res := resTmp.(ent.Noder) fc.Result = res - return ec.marshalONode2githubᚗcomᚋtestifysecᚋarchivistaᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalONode2githubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐNoder(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Query_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -2261,7 +2793,7 @@ func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.Coll } res := resTmp.([]ent.Noder) fc.Result = res - return ec.marshalNNode2ᚕgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalNNode2ᚕgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐNoder(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Query_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -2288,6 +2820,69 @@ func (ec *executionContext) fieldContext_Query_nodes(ctx context.Context, field return fc, nil } +func (ec *executionContext) _Query_attestationPolicies(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_attestationPolicies(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.Query().AttestationPolicies(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["where"].(*ent.AttestationPolicyWhereInput)) + }) + 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.(*ent.AttestationPolicyConnection) + fc.Result = res + return ec.marshalNAttestationPolicyConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_attestationPolicies(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + 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_AttestationPolicyConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_AttestationPolicyConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_AttestationPolicyConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AttestationPolicyConnection", 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_attestationPolicies_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + func (ec *executionContext) _Query_dsses(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Query_dsses(ctx, field) if err != nil { @@ -2316,7 +2911,7 @@ func (ec *executionContext) _Query_dsses(ctx context.Context, field graphql.Coll } res := resTmp.(*ent.DsseConnection) fc.Result = res - return ec.marshalNDsseConnection2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseConnection(ctx, field.Selections, res) + return ec.marshalNDsseConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseConnection(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Query_dsses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -2379,7 +2974,7 @@ func (ec *executionContext) _Query_subjects(ctx context.Context, field graphql.C } res := resTmp.(*ent.SubjectConnection) fc.Result = res - return ec.marshalNSubjectConnection2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectConnection(ctx, field.Selections, res) + return ec.marshalNSubjectConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectConnection(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Query_subjects(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -2700,7 +3295,7 @@ func (ec *executionContext) _Signature_dsse(ctx context.Context, field graphql.C } res := resTmp.(*ent.Dsse) fc.Result = res - return ec.marshalODsse2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsse(ctx, field.Selections, res) + return ec.marshalODsse2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsse(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Signature_dsse(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -2755,7 +3350,7 @@ func (ec *executionContext) _Signature_timestamps(ctx context.Context, field gra } res := resTmp.([]*ent.Timestamp) fc.Result = res - return ec.marshalOTimestamp2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestampᚄ(ctx, field.Selections, res) + return ec.marshalOTimestamp2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampᚄ(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Signature_timestamps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -2895,12 +3490,72 @@ func (ec *executionContext) _Statement_subjects(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(*ent.SubjectConnection) + res := resTmp.(*ent.SubjectConnection) + fc.Result = res + return ec.marshalNSubjectConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Statement_subjects(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Statement", + 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_SubjectConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_SubjectConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_SubjectConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SubjectConnection", 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_Statement_subjects_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Statement_policy(ctx context.Context, field graphql.CollectedField, obj *ent.Statement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Statement_policy(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.Policy(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*ent.AttestationPolicy) fc.Result = res - return ec.marshalNSubjectConnection2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectConnection(ctx, field.Selections, res) + return ec.marshalOAttestationPolicy2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Statement_subjects(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Statement_policy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Statement", Field: field, @@ -2908,27 +3563,16 @@ func (ec *executionContext) fieldContext_Statement_subjects(ctx context.Context, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_SubjectConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_SubjectConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_SubjectConnection_totalCount(ctx, field) + case "id": + return ec.fieldContext_AttestationPolicy_id(ctx, field) + case "name": + return ec.fieldContext_AttestationPolicy_name(ctx, field) + case "statement": + return ec.fieldContext_AttestationPolicy_statement(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type SubjectConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type AttestationPolicy", 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_Statement_subjects_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } @@ -2957,7 +3601,7 @@ func (ec *executionContext) _Statement_attestationCollections(ctx context.Contex } res := resTmp.(*ent.AttestationCollection) fc.Result = res - return ec.marshalOAttestationCollection2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollection(ctx, field.Selections, res) + return ec.marshalOAttestationCollection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollection(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Statement_attestationCollections(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -3008,7 +3652,7 @@ func (ec *executionContext) _Statement_dsse(ctx context.Context, field graphql.C } res := resTmp.([]*ent.Dsse) fc.Result = res - return ec.marshalODsse2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseᚄ(ctx, field.Selections, res) + return ec.marshalODsse2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseᚄ(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Statement_dsse(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -3151,7 +3795,7 @@ func (ec *executionContext) _Subject_subjectDigests(ctx context.Context, field g } res := resTmp.([]*ent.SubjectDigest) fc.Result = res - return ec.marshalOSubjectDigest2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigestᚄ(ctx, field.Selections, res) + return ec.marshalOSubjectDigest2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestᚄ(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Subject_subjectDigests(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -3202,7 +3846,7 @@ func (ec *executionContext) _Subject_statement(ctx context.Context, field graphq } res := resTmp.(*ent.Statement) fc.Result = res - return ec.marshalOStatement2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatement(ctx, field.Selections, res) + return ec.marshalOStatement2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatement(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Subject_statement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -3219,6 +3863,8 @@ func (ec *executionContext) fieldContext_Subject_statement(ctx context.Context, return ec.fieldContext_Statement_predicate(ctx, field) case "subjects": return ec.fieldContext_Statement_subjects(ctx, field) + case "policy": + return ec.fieldContext_Statement_policy(ctx, field) case "attestationCollections": return ec.fieldContext_Statement_attestationCollections(ctx, field) case "dsse": @@ -3255,7 +3901,7 @@ func (ec *executionContext) _SubjectConnection_edges(ctx context.Context, field } res := resTmp.([]*ent.SubjectEdge) fc.Result = res - return ec.marshalOSubjectEdge2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectEdge(ctx, field.Selections, res) + return ec.marshalOSubjectEdge2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectEdge(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_SubjectConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -3532,7 +4178,7 @@ func (ec *executionContext) _SubjectDigest_subject(ctx context.Context, field gr } res := resTmp.(*ent.Subject) fc.Result = res - return ec.marshalOSubject2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubject(ctx, field.Selections, res) + return ec.marshalOSubject2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubject(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_SubjectDigest_subject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -3583,7 +4229,7 @@ func (ec *executionContext) _SubjectEdge_node(ctx context.Context, field graphql } res := resTmp.(*ent.Subject) fc.Result = res - return ec.marshalOSubject2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubject(ctx, field.Selections, res) + return ec.marshalOSubject2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubject(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_SubjectEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -3810,7 +4456,7 @@ func (ec *executionContext) _Timestamp_signature(ctx context.Context, field grap } res := resTmp.(*ent.Signature) fc.Result = res - return ec.marshalOSignature2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignature(ctx, field.Selections, res) + return ec.marshalOSignature2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignature(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Timestamp_signature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -5560,65 +6206,281 @@ func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, fiel 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 + 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) unmarshalInputAttestationCollectionWhereInput(ctx context.Context, obj interface{}) (ent.AttestationCollectionWhereInput, error) { + var it ent.AttestationCollectionWhereInput + 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", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "hasAttestations", "hasAttestationsWith", "hasStatement", "hasStatementWith"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) + data, err := ec.unmarshalOAttestationCollectionWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollectionWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "idNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDNEQ = data + case "idIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) + data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDIn = data + case "idNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) + data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDNotIn = data + case "idGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDGT = data + case "idGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDGTE = data + case "idLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDLT = data + case "idLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "name": + 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": + 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": + 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": + 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": + 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": + 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": + 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": + 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": + 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": + 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": + 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": + 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": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NameContainsFold = data + case "hasAttestations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestations")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasAttestations = data + case "hasAttestationsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestationsWith")) + data, err := ec.unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasAttestationsWith = data + case "hasStatement": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatement")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasStatement = data + case "hasStatementWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatementWith")) + data, err := ec.unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatementWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasStatementWith = data } - }() - 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 + return it, nil } -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx context.Context, obj interface{}) (ent.AttestationCollectionWhereInput, error) { - var it ent.AttestationCollectionWhereInput +func (ec *executionContext) unmarshalInputAttestationPolicyWhereInput(ctx context.Context, obj interface{}) (ent.AttestationPolicyWhereInput, error) { + var it ent.AttestationPolicyWhereInput 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", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "hasAttestations", "hasAttestationsWith", "hasStatement", "hasStatementWith"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "hasStatement", "hasStatementWith"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -5626,35 +6488,27 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } switch k { case "not": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOAttestationCollectionWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollectionWhereInput(ctx, v) + data, err := ec.unmarshalOAttestationPolicyWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInput(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.unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOAttestationPolicyWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInputᚄ(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.unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOAttestationPolicyWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInputᚄ(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ᚖint(ctx, v) if err != nil { @@ -5662,8 +6516,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } it.ID = data case "idNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -5671,8 +6523,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } it.IDNEQ = data case "idIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -5680,8 +6530,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } it.IDIn = data case "idNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -5689,8 +6537,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } it.IDNotIn = data case "idGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -5698,8 +6544,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } it.IDGT = data case "idGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -5707,8 +6551,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } it.IDGTE = data case "idLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -5716,8 +6558,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } it.IDLT = data case "idLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -5725,8 +6565,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } it.IDLTE = data case "name": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -5734,8 +6572,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 { @@ -5743,8 +6579,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 { @@ -5752,8 +6586,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 { @@ -5761,8 +6593,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 { @@ -5770,8 +6600,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 { @@ -5779,8 +6607,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 { @@ -5788,8 +6614,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 { @@ -5797,8 +6621,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 { @@ -5806,8 +6628,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 { @@ -5815,8 +6635,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 { @@ -5824,8 +6642,6 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 { @@ -5833,35 +6649,13 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } 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 "hasAttestations": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestations")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err - } - it.HasAttestations = data - case "hasAttestationsWith": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestationsWith")) - data, err := ec.unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationWhereInputᚄ(ctx, v) - if err != nil { - return it, err - } - it.HasAttestationsWith = data case "hasStatement": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatement")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -5869,10 +6663,8 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co } it.HasStatement = data case "hasStatementWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatementWith")) - data, err := ec.unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatementWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatementWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -5898,35 +6690,27 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } switch k { case "not": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOAttestationWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationWhereInput(ctx, v) + data, err := ec.unmarshalOAttestationWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInput(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.unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInputᚄ(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.unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInputᚄ(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ᚖint(ctx, v) if err != nil { @@ -5934,8 +6718,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.ID = data case "idNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -5943,8 +6725,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.IDNEQ = data case "idIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -5952,8 +6732,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.IDIn = data case "idNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -5961,8 +6739,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.IDNotIn = data case "idGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -5970,8 +6746,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.IDGT = data case "idGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -5979,8 +6753,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.IDGTE = data case "idLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -5988,8 +6760,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.IDLT = data case "idLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -5997,8 +6767,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.IDLTE = data case "type": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6006,8 +6774,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.Type = data case "typeNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6015,8 +6781,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeNEQ = data case "typeIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -6024,8 +6788,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeIn = data case "typeNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -6033,8 +6795,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeNotIn = data case "typeGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6042,8 +6802,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeGT = data case "typeGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6051,8 +6809,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeGTE = data case "typeLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6060,8 +6816,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeLT = data case "typeLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6069,8 +6823,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeLTE = data case "typeContains": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6078,8 +6830,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeContains = data case "typeHasPrefix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6087,8 +6837,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeHasPrefix = data case "typeHasSuffix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6096,8 +6844,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeHasSuffix = data case "typeEqualFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6105,8 +6851,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeEqualFold = data case "typeContainsFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6114,8 +6858,6 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.TypeContainsFold = data case "hasAttestationCollection": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestationCollection")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -6123,10 +6865,8 @@ func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Cont } it.HasAttestationCollection = data case "hasAttestationCollectionWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestationCollectionWith")) - data, err := ec.unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -6152,35 +6892,27 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } switch k { case "not": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalODsseWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseWhereInput(ctx, v) + data, err := ec.unmarshalODsseWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInput(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.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) + data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInputᚄ(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.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) + data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInputᚄ(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ᚖint(ctx, v) if err != nil { @@ -6188,8 +6920,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.ID = data case "idNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -6197,8 +6927,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.IDNEQ = data case "idIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -6206,8 +6934,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.IDIn = data case "idNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -6215,8 +6941,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.IDNotIn = data case "idGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -6224,8 +6948,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.IDGT = data case "idGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -6233,8 +6955,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.IDGTE = data case "idLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -6242,8 +6962,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.IDLT = data case "idLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -6251,8 +6969,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.IDLTE = data case "gitoidSha256": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6260,8 +6976,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256 = data case "gitoidSha256NEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256NEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6269,8 +6983,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256NEQ = data case "gitoidSha256In": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256In")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -6278,8 +6990,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256In = data case "gitoidSha256NotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256NotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -6287,8 +6997,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256NotIn = data case "gitoidSha256GT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256GT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6296,8 +7004,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256GT = data case "gitoidSha256GTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256GTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6305,8 +7011,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256GTE = data case "gitoidSha256LT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256LT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6314,8 +7018,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256LT = data case "gitoidSha256LTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256LTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6323,8 +7025,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256LTE = data case "gitoidSha256Contains": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256Contains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6332,8 +7032,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256Contains = data case "gitoidSha256HasPrefix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256HasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6341,8 +7039,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256HasPrefix = data case "gitoidSha256HasSuffix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256HasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6350,8 +7046,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256HasSuffix = data case "gitoidSha256EqualFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256EqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6359,8 +7053,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256EqualFold = data case "gitoidSha256ContainsFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256ContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6368,8 +7060,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.GitoidSha256ContainsFold = data case "payloadType": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadType")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6377,8 +7067,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadType = data case "payloadTypeNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6386,8 +7074,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeNEQ = data case "payloadTypeIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -6395,8 +7081,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeIn = data case "payloadTypeNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -6404,8 +7088,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeNotIn = data case "payloadTypeGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6413,8 +7095,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeGT = data case "payloadTypeGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6422,8 +7102,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeGTE = data case "payloadTypeLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6431,8 +7109,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeLT = data case "payloadTypeLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6440,8 +7116,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeLTE = data case "payloadTypeContains": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6449,8 +7123,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeContains = data case "payloadTypeHasPrefix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6458,8 +7130,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeHasPrefix = data case "payloadTypeHasSuffix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6467,8 +7137,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeHasSuffix = data case "payloadTypeEqualFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6476,8 +7144,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeEqualFold = data case "payloadTypeContainsFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6485,8 +7151,6 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.PayloadTypeContainsFold = data case "hasStatement": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatement")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -6494,17 +7158,13 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.HasStatement = data case "hasStatementWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatementWith")) - data, err := ec.unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatementWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatementWhereInputᚄ(ctx, v) if err != nil { return it, err } it.HasStatementWith = data case "hasSignatures": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSignatures")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -6512,17 +7172,13 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.HasSignatures = data case "hasSignaturesWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSignaturesWith")) - data, err := ec.unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignatureWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureWhereInputᚄ(ctx, v) if err != nil { return it, err } it.HasSignaturesWith = data case "hasPayloadDigests": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPayloadDigests")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -6530,10 +7186,8 @@ func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, ob } it.HasPayloadDigests = data case "hasPayloadDigestsWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPayloadDigestsWith")) - data, err := ec.unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigestWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -6559,35 +7213,27 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } switch k { case "not": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOPayloadDigestWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigestWhereInput(ctx, v) + data, err := ec.unmarshalOPayloadDigestWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestWhereInput(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.unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigestWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestWhereInputᚄ(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.unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigestWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestWhereInputᚄ(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ᚖint(ctx, v) if err != nil { @@ -6595,8 +7241,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ID = data case "idNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -6604,8 +7248,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.IDNEQ = data case "idIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -6613,8 +7255,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.IDIn = data case "idNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -6622,8 +7262,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.IDNotIn = data case "idGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -6631,8 +7269,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.IDGT = data case "idGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -6640,8 +7276,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.IDGTE = data case "idLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -6649,8 +7283,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.IDLT = data case "idLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -6658,8 +7290,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.IDLTE = data case "algorithm": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithm")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6667,8 +7297,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.Algorithm = data case "algorithmNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6676,8 +7304,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmNEQ = data case "algorithmIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -6685,8 +7311,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmIn = data case "algorithmNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -6694,8 +7318,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmNotIn = data case "algorithmGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6703,8 +7325,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmGT = data case "algorithmGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6712,8 +7332,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmGTE = data case "algorithmLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6721,8 +7339,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmLT = data case "algorithmLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6730,8 +7346,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmLTE = data case "algorithmContains": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6739,8 +7353,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmContains = data case "algorithmHasPrefix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6748,8 +7360,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmHasPrefix = data case "algorithmHasSuffix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6757,8 +7367,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmHasSuffix = data case "algorithmEqualFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6766,8 +7374,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmEqualFold = data case "algorithmContainsFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6775,8 +7381,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.AlgorithmContainsFold = data case "value": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6784,8 +7388,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.Value = data case "valueNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6793,8 +7395,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueNEQ = data case "valueIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -6802,8 +7402,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueIn = data case "valueNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -6811,8 +7409,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueNotIn = data case "valueGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6820,8 +7416,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueGT = data case "valueGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6829,8 +7423,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueGTE = data case "valueLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6838,8 +7430,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueLT = data case "valueLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6847,8 +7437,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueLTE = data case "valueContains": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6856,8 +7444,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueContains = data case "valueHasPrefix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6865,8 +7451,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueHasPrefix = data case "valueHasSuffix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6874,8 +7458,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueHasSuffix = data case "valueEqualFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6883,8 +7465,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueEqualFold = data case "valueContainsFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -6892,8 +7472,6 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.ValueContainsFold = data case "hasDsse": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDsse")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -6901,10 +7479,8 @@ func (ec *executionContext) unmarshalInputPayloadDigestWhereInput(ctx context.Co } it.HasDsse = data case "hasDsseWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDsseWith")) - data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) + data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -6930,35 +7506,27 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } switch k { case "not": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOSignatureWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignatureWhereInput(ctx, v) + data, err := ec.unmarshalOSignatureWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureWhereInput(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.unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignatureWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureWhereInputᚄ(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.unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignatureWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureWhereInputᚄ(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ᚖint(ctx, v) if err != nil { @@ -6966,8 +7534,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.ID = data case "idNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -6975,8 +7541,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.IDNEQ = data case "idIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -6984,8 +7548,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.IDIn = data case "idNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -6993,8 +7555,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.IDNotIn = data case "idGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7002,8 +7562,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.IDGT = data case "idGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7011,8 +7569,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.IDGTE = data case "idLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7020,8 +7576,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.IDLT = data case "idLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7029,8 +7583,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.IDLTE = data case "keyID": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyID")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7038,8 +7590,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyID = data case "keyIDNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7047,8 +7597,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDNEQ = data case "keyIDIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -7056,8 +7604,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDIn = data case "keyIDNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -7065,8 +7611,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDNotIn = data case "keyIDGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7074,8 +7618,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDGT = data case "keyIDGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7083,8 +7625,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDGTE = data case "keyIDLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7092,8 +7632,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDLT = data case "keyIDLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7101,8 +7639,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDLTE = data case "keyIDContains": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7110,8 +7646,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDContains = data case "keyIDHasPrefix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7119,8 +7653,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDHasPrefix = data case "keyIDHasSuffix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7128,8 +7660,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDHasSuffix = data case "keyIDEqualFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7137,8 +7667,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDEqualFold = data case "keyIDContainsFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyIDContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7146,8 +7674,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.KeyIDContainsFold = data case "signature": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signature")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7155,8 +7681,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.Signature = data case "signatureNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7164,8 +7688,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureNEQ = data case "signatureIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -7173,8 +7695,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureIn = data case "signatureNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -7182,8 +7702,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureNotIn = data case "signatureGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7191,8 +7709,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureGT = data case "signatureGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7200,8 +7716,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureGTE = data case "signatureLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7209,8 +7723,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureLT = data case "signatureLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7218,8 +7730,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureLTE = data case "signatureContains": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7227,8 +7737,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureContains = data case "signatureHasPrefix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7236,8 +7744,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureHasPrefix = data case "signatureHasSuffix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7245,8 +7751,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureHasSuffix = data case "signatureEqualFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7254,8 +7758,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureEqualFold = data case "signatureContainsFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7263,8 +7765,6 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.SignatureContainsFold = data case "hasDsse": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDsse")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -7272,17 +7772,13 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.HasDsse = data case "hasDsseWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDsseWith")) - data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) + data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) if err != nil { return it, err } it.HasDsseWith = data case "hasTimestamps": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTimestamps")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -7290,10 +7786,8 @@ func (ec *executionContext) unmarshalInputSignatureWhereInput(ctx context.Contex } it.HasTimestamps = data case "hasTimestampsWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTimestampsWith")) - data, err := ec.unmarshalOTimestampWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestampWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOTimestampWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -7311,7 +7805,7 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "predicate", "predicateNEQ", "predicateIn", "predicateNotIn", "predicateGT", "predicateGTE", "predicateLT", "predicateLTE", "predicateContains", "predicateHasPrefix", "predicateHasSuffix", "predicateEqualFold", "predicateContainsFold", "hasSubjects", "hasSubjectsWith", "hasAttestationCollections", "hasAttestationCollectionsWith", "hasDsse", "hasDsseWith"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "predicate", "predicateNEQ", "predicateIn", "predicateNotIn", "predicateGT", "predicateGTE", "predicateLT", "predicateLTE", "predicateContains", "predicateHasPrefix", "predicateHasSuffix", "predicateEqualFold", "predicateContainsFold", "hasSubjects", "hasSubjectsWith", "hasPolicy", "hasPolicyWith", "hasAttestationCollections", "hasAttestationCollectionsWith", "hasDsse", "hasDsseWith"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -7319,35 +7813,27 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } switch k { case "not": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOStatementWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatementWhereInput(ctx, v) + data, err := ec.unmarshalOStatementWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatementWhereInput(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.unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatementWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatementWhereInputᚄ(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.unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatementWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatementWhereInputᚄ(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ᚖint(ctx, v) if err != nil { @@ -7355,8 +7841,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.ID = data case "idNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7364,8 +7848,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.IDNEQ = data case "idIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -7373,8 +7855,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.IDIn = data case "idNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -7382,8 +7862,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.IDNotIn = data case "idGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7391,8 +7869,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.IDGT = data case "idGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7400,8 +7876,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.IDGTE = data case "idLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7409,8 +7883,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.IDLT = data case "idLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7418,8 +7890,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.IDLTE = data case "predicate": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicate")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7427,8 +7897,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.Predicate = data case "predicateNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7436,8 +7904,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateNEQ = data case "predicateIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -7445,8 +7911,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateIn = data case "predicateNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -7454,8 +7918,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateNotIn = data case "predicateGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7463,8 +7925,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateGT = data case "predicateGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7472,8 +7932,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateGTE = data case "predicateLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7481,8 +7939,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateLT = data case "predicateLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7490,8 +7946,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateLTE = data case "predicateContains": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7499,8 +7953,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateContains = data case "predicateHasPrefix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7508,8 +7960,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateHasPrefix = data case "predicateHasSuffix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7517,8 +7967,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateHasSuffix = data case "predicateEqualFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7526,8 +7974,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateEqualFold = data case "predicateContainsFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("predicateContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7535,8 +7981,6 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.PredicateContainsFold = data case "hasSubjects": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubjects")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -7544,17 +7988,27 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.HasSubjects = data case "hasSubjectsWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubjectsWith")) - data, err := ec.unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectWhereInputᚄ(ctx, v) if err != nil { return it, err } it.HasSubjectsWith = data + case "hasPolicy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPolicy")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasPolicy = data + case "hasPolicyWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPolicyWith")) + data, err := ec.unmarshalOAttestationPolicyWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasPolicyWith = data case "hasAttestationCollections": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestationCollections")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -7562,17 +8016,13 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.HasAttestationCollections = data case "hasAttestationCollectionsWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestationCollectionsWith")) - data, err := ec.unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx, v) if err != nil { return it, err } it.HasAttestationCollectionsWith = data case "hasDsse": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDsse")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -7580,10 +8030,8 @@ func (ec *executionContext) unmarshalInputStatementWhereInput(ctx context.Contex } it.HasDsse = data case "hasDsseWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDsseWith")) - data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) + data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -7609,35 +8057,27 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } switch k { case "not": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOSubjectDigestWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigestWhereInput(ctx, v) + data, err := ec.unmarshalOSubjectDigestWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestWhereInput(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.unmarshalOSubjectDigestWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigestWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOSubjectDigestWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestWhereInputᚄ(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.unmarshalOSubjectDigestWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigestWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOSubjectDigestWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestWhereInputᚄ(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ᚖint(ctx, v) if err != nil { @@ -7645,8 +8085,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ID = data case "idNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7654,8 +8092,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.IDNEQ = data case "idIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -7663,8 +8099,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.IDIn = data case "idNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -7672,8 +8106,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.IDNotIn = data case "idGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7681,8 +8113,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.IDGT = data case "idGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7690,8 +8120,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.IDGTE = data case "idLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7699,8 +8127,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.IDLT = data case "idLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -7708,8 +8134,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.IDLTE = data case "algorithm": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithm")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7717,8 +8141,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.Algorithm = data case "algorithmNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7726,8 +8148,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmNEQ = data case "algorithmIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -7735,8 +8155,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmIn = data case "algorithmNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -7744,8 +8162,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmNotIn = data case "algorithmGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7753,8 +8169,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmGT = data case "algorithmGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7762,8 +8176,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmGTE = data case "algorithmLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7771,8 +8183,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmLT = data case "algorithmLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7780,8 +8190,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmLTE = data case "algorithmContains": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7789,8 +8197,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmContains = data case "algorithmHasPrefix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7798,8 +8204,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmHasPrefix = data case "algorithmHasSuffix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7807,8 +8211,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmHasSuffix = data case "algorithmEqualFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7816,8 +8218,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmEqualFold = data case "algorithmContainsFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("algorithmContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7825,8 +8225,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.AlgorithmContainsFold = data case "value": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7834,8 +8232,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.Value = data case "valueNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7843,8 +8239,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueNEQ = data case "valueIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -7852,8 +8246,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueIn = data case "valueNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -7861,8 +8253,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueNotIn = data case "valueGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7870,8 +8260,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueGT = data case "valueGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7879,8 +8267,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueGTE = data case "valueLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7888,8 +8274,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueLT = data case "valueLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7897,8 +8281,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueLTE = data case "valueContains": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7906,8 +8288,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueContains = data case "valueHasPrefix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7915,8 +8295,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueHasPrefix = data case "valueHasSuffix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7924,8 +8302,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueHasSuffix = data case "valueEqualFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7933,8 +8309,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueEqualFold = data case "valueContainsFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("valueContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -7942,8 +8316,6 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.ValueContainsFold = data case "hasSubject": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubject")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -7951,10 +8323,8 @@ func (ec *executionContext) unmarshalInputSubjectDigestWhereInput(ctx context.Co } it.HasSubject = data case "hasSubjectWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubjectWith")) - data, err := ec.unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -7980,35 +8350,27 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } switch k { case "not": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOSubjectWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectWhereInput(ctx, v) + data, err := ec.unmarshalOSubjectWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectWhereInput(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.unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectWhereInputᚄ(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.unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectWhereInputᚄ(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ᚖint(ctx, v) if err != nil { @@ -8016,8 +8378,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } it.ID = data case "idNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -8025,8 +8385,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } it.IDNEQ = data case "idIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -8034,8 +8392,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } it.IDIn = data case "idNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -8043,8 +8399,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } it.IDNotIn = data case "idGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -8052,8 +8406,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } it.IDGT = data case "idGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -8061,8 +8413,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } it.IDGTE = data case "idLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -8070,8 +8420,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } it.IDLT = data case "idLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -8079,8 +8427,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } it.IDLTE = data case "name": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8088,8 +8434,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8097,8 +8441,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8106,8 +8448,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8115,8 +8455,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8124,8 +8462,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8133,8 +8469,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8142,8 +8476,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8151,8 +8483,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8160,8 +8490,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8169,8 +8497,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8178,8 +8504,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8187,8 +8511,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } 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 { @@ -8196,8 +8518,6 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } it.NameContainsFold = data case "hasSubjectDigests": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubjectDigests")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -8205,17 +8525,13 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } it.HasSubjectDigests = data case "hasSubjectDigestsWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubjectDigestsWith")) - data, err := ec.unmarshalOSubjectDigestWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigestWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOSubjectDigestWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestWhereInputᚄ(ctx, v) if err != nil { return it, err } it.HasSubjectDigestsWith = data case "hasStatement": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatement")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -8223,10 +8539,8 @@ func (ec *executionContext) unmarshalInputSubjectWhereInput(ctx context.Context, } it.HasStatement = data case "hasStatementWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatementWith")) - data, err := ec.unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatementWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatementWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -8252,35 +8566,27 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } switch k { case "not": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOTimestampWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestampWhereInput(ctx, v) + data, err := ec.unmarshalOTimestampWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampWhereInput(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.unmarshalOTimestampWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestampWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOTimestampWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampWhereInputᚄ(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.unmarshalOTimestampWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestampWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOTimestampWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampWhereInputᚄ(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ᚖint(ctx, v) if err != nil { @@ -8288,8 +8594,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.ID = data case "idNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -8297,8 +8601,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.IDNEQ = data case "idIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -8306,8 +8608,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.IDIn = data case "idNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { @@ -8315,8 +8615,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.IDNotIn = data case "idGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -8324,8 +8622,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.IDGT = data case "idGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -8333,8 +8629,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.IDGTE = data case "idLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -8342,8 +8636,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.IDLT = data case "idLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { @@ -8351,8 +8643,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.IDLTE = data case "type": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8360,8 +8650,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.Type = data case "typeNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8369,8 +8657,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeNEQ = data case "typeIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -8378,8 +8664,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeIn = data case "typeNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { @@ -8387,8 +8671,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeNotIn = data case "typeGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8396,8 +8678,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeGT = data case "typeGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8405,8 +8685,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeGTE = data case "typeLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8414,8 +8692,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeLT = data case "typeLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8423,8 +8699,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeLTE = data case "typeContains": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8432,8 +8706,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeContains = data case "typeHasPrefix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8441,8 +8713,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeHasPrefix = data case "typeHasSuffix": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8450,8 +8720,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeHasSuffix = data case "typeEqualFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8459,8 +8727,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeEqualFold = data case "typeContainsFold": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { @@ -8468,8 +8734,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TypeContainsFold = data case "timestamp": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("timestamp")) data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) if err != nil { @@ -8477,8 +8741,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.Timestamp = data case "timestampNEQ": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("timestampNEQ")) data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) if err != nil { @@ -8486,8 +8748,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TimestampNEQ = data case "timestampIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("timestampIn")) data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) if err != nil { @@ -8495,8 +8755,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TimestampIn = data case "timestampNotIn": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("timestampNotIn")) data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) if err != nil { @@ -8504,8 +8762,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TimestampNotIn = data case "timestampGT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("timestampGT")) data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) if err != nil { @@ -8513,8 +8769,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TimestampGT = data case "timestampGTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("timestampGTE")) data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) if err != nil { @@ -8522,8 +8776,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TimestampGTE = data case "timestampLT": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("timestampLT")) data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) if err != nil { @@ -8531,8 +8783,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TimestampLT = data case "timestampLTE": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("timestampLTE")) data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) if err != nil { @@ -8540,8 +8790,6 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.TimestampLTE = data case "hasSignature": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSignature")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { @@ -8549,10 +8797,8 @@ func (ec *executionContext) unmarshalInputTimestampWhereInput(ctx context.Contex } it.HasSignature = data case "hasSignatureWith": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSignatureWith")) - data, err := ec.unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignatureWhereInputᚄ(ctx, v) + data, err := ec.unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -8581,6 +8827,11 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._AttestationCollection(ctx, sel, obj) + case *ent.AttestationPolicy: + if obj == nil { + return graphql.Null + } + return ec._AttestationPolicy(ctx, sel, obj) case *ent.Dsse: if obj == nil { return graphql.Null @@ -8646,7 +8897,120 @@ func (ec *executionContext) _Attestation(ctx context.Context, sel ast.SelectionS if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "attestationCollection": + case "attestationCollection": + 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._Attestation_attestationCollection(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(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 attestationCollectionImplementors = []string{"AttestationCollection", "Node"} + +func (ec *executionContext) _AttestationCollection(ctx context.Context, sel ast.SelectionSet, obj *ent.AttestationCollection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, attestationCollectionImplementors) + + 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("AttestationCollection") + case "id": + out.Values[i] = ec._AttestationCollection_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "name": + out.Values[i] = ec._AttestationCollection_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "attestations": + 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._AttestationCollection_attestations(ctx, field, obj) + 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 "statement": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -8655,7 +9019,7 @@ func (ec *executionContext) _Attestation(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Attestation_attestationCollection(ctx, field, obj) + res = ec._AttestationCollection_statement(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -8705,28 +9069,28 @@ func (ec *executionContext) _Attestation(ctx context.Context, sel ast.SelectionS return out } -var attestationCollectionImplementors = []string{"AttestationCollection", "Node"} +var attestationPolicyImplementors = []string{"AttestationPolicy", "Node"} -func (ec *executionContext) _AttestationCollection(ctx context.Context, sel ast.SelectionSet, obj *ent.AttestationCollection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, attestationCollectionImplementors) +func (ec *executionContext) _AttestationPolicy(ctx context.Context, sel ast.SelectionSet, obj *ent.AttestationPolicy) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, attestationPolicyImplementors) 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("AttestationCollection") + out.Values[i] = graphql.MarshalString("AttestationPolicy") case "id": - out.Values[i] = ec._AttestationCollection_id(ctx, field, obj) + out.Values[i] = ec._AttestationPolicy_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } case "name": - out.Values[i] = ec._AttestationCollection_name(ctx, field, obj) + out.Values[i] = ec._AttestationPolicy_name(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "attestations": + case "statement": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -8735,7 +9099,7 @@ func (ec *executionContext) _AttestationCollection(ctx context.Context, sel ast. ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._AttestationCollection_attestations(ctx, field, obj) + res = ec._AttestationPolicy_statement(ctx, field, obj) return res } @@ -8759,42 +9123,93 @@ func (ec *executionContext) _AttestationCollection(ctx context.Context, sel ast. } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "statement": - field := field + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } - 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._AttestationCollection_statement(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } + atomic.AddInt32(&ec.deferred, int32(len(deferred))) - 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) - }) + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue + return out +} + +var attestationPolicyConnectionImplementors = []string{"AttestationPolicyConnection"} + +func (ec *executionContext) _AttestationPolicyConnection(ctx context.Context, sel ast.SelectionSet, obj *ent.AttestationPolicyConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, attestationPolicyConnectionImplementors) + + 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("AttestationPolicyConnection") + case "edges": + out.Values[i] = ec._AttestationPolicyConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._AttestationPolicyConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._AttestationPolicyConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + 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 attestationPolicyEdgeImplementors = []string{"AttestationPolicyEdge"} + +func (ec *executionContext) _AttestationPolicyEdge(ctx context.Context, sel ast.SelectionSet, obj *ent.AttestationPolicyEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, attestationPolicyEdgeImplementors) + + 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("AttestationPolicyEdge") + case "node": + out.Values[i] = ec._AttestationPolicyEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._AttestationPolicyEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -9242,6 +9657,28 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "attestationPolicies": + 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._Query_attestationPolicies(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + 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) }) case "dsses": field := field @@ -9489,6 +9926,39 @@ func (ec *executionContext) _Statement(ctx context.Context, sel ast.SelectionSet continue } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "policy": + 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._Statement_policy(ctx, field, obj) + 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 "attestationCollections": field := field @@ -10266,7 +10736,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o // region ***************************** type.gotpl ***************************** -func (ec *executionContext) marshalNAttestation2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestation(ctx context.Context, sel ast.SelectionSet, v *ent.Attestation) graphql.Marshaler { +func (ec *executionContext) marshalNAttestation2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestation(ctx context.Context, sel ast.SelectionSet, v *ent.Attestation) 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") @@ -10276,7 +10746,7 @@ func (ec *executionContext) marshalNAttestation2ᚖgithubᚗcomᚋtestifysecᚋa return ec._Attestation(ctx, sel, v) } -func (ec *executionContext) marshalNAttestationCollection2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollection(ctx context.Context, sel ast.SelectionSet, v *ent.AttestationCollection) graphql.Marshaler { +func (ec *executionContext) marshalNAttestationCollection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollection(ctx context.Context, sel ast.SelectionSet, v *ent.AttestationCollection) 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") @@ -10286,12 +10756,31 @@ func (ec *executionContext) marshalNAttestationCollection2ᚖgithubᚗcomᚋtest return ec._AttestationCollection(ctx, sel, v) } -func (ec *executionContext) unmarshalNAttestationCollectionWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollectionWhereInput(ctx context.Context, v interface{}) (*ent.AttestationCollectionWhereInput, error) { +func (ec *executionContext) unmarshalNAttestationCollectionWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollectionWhereInput(ctx context.Context, v interface{}) (*ent.AttestationCollectionWhereInput, error) { res, err := ec.unmarshalInputAttestationCollectionWhereInput(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNAttestationWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationWhereInput(ctx context.Context, v interface{}) (*ent.AttestationWhereInput, error) { +func (ec *executionContext) marshalNAttestationPolicyConnection2githubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyConnection(ctx context.Context, sel ast.SelectionSet, v ent.AttestationPolicyConnection) graphql.Marshaler { + return ec._AttestationPolicyConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNAttestationPolicyConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyConnection(ctx context.Context, sel ast.SelectionSet, v *ent.AttestationPolicyConnection) 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._AttestationPolicyConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNAttestationPolicyWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInput(ctx context.Context, v interface{}) (*ent.AttestationPolicyWhereInput, error) { + res, err := ec.unmarshalInputAttestationPolicyWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNAttestationWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInput(ctx context.Context, v interface{}) (*ent.AttestationWhereInput, error) { res, err := ec.unmarshalInputAttestationWhereInput(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } @@ -10321,7 +10810,7 @@ func (ec *executionContext) marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCurso return v } -func (ec *executionContext) marshalNDsse2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsse(ctx context.Context, sel ast.SelectionSet, v *ent.Dsse) graphql.Marshaler { +func (ec *executionContext) marshalNDsse2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsse(ctx context.Context, sel ast.SelectionSet, v *ent.Dsse) 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") @@ -10331,11 +10820,11 @@ func (ec *executionContext) marshalNDsse2ᚖgithubᚗcomᚋtestifysecᚋarchivis return ec._Dsse(ctx, sel, v) } -func (ec *executionContext) marshalNDsseConnection2githubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseConnection(ctx context.Context, sel ast.SelectionSet, v ent.DsseConnection) graphql.Marshaler { +func (ec *executionContext) marshalNDsseConnection2githubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseConnection(ctx context.Context, sel ast.SelectionSet, v ent.DsseConnection) graphql.Marshaler { return ec._DsseConnection(ctx, sel, &v) } -func (ec *executionContext) marshalNDsseConnection2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseConnection(ctx context.Context, sel ast.SelectionSet, v *ent.DsseConnection) graphql.Marshaler { +func (ec *executionContext) marshalNDsseConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseConnection(ctx context.Context, sel ast.SelectionSet, v *ent.DsseConnection) 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") @@ -10345,7 +10834,7 @@ func (ec *executionContext) marshalNDsseConnection2ᚖgithubᚗcomᚋtestifysec return ec._DsseConnection(ctx, sel, v) } -func (ec *executionContext) unmarshalNDsseWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseWhereInput(ctx context.Context, v interface{}) (*ent.DsseWhereInput, error) { +func (ec *executionContext) unmarshalNDsseWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInput(ctx context.Context, v interface{}) (*ent.DsseWhereInput, error) { res, err := ec.unmarshalInputDsseWhereInput(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } @@ -10412,7 +10901,7 @@ func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.Selecti return res } -func (ec *executionContext) marshalNNode2ᚕgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐNoder(ctx context.Context, sel ast.SelectionSet, v []ent.Noder) graphql.Marshaler { +func (ec *executionContext) marshalNNode2ᚕgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐNoder(ctx context.Context, sel ast.SelectionSet, v []ent.Noder) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -10436,7 +10925,7 @@ func (ec *executionContext) marshalNNode2ᚕgithubᚗcomᚋtestifysecᚋarchivis if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalONode2githubᚗcomᚋtestifysecᚋarchivistaᚋentᚐNoder(ctx, sel, v[i]) + ret[i] = ec.marshalONode2githubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐNoder(ctx, sel, v[i]) } if isLen1 { f(i) @@ -10454,7 +10943,7 @@ func (ec *executionContext) marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPag return ec._PageInfo(ctx, sel, &v) } -func (ec *executionContext) marshalNPayloadDigest2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigest(ctx context.Context, sel ast.SelectionSet, v *ent.PayloadDigest) graphql.Marshaler { +func (ec *executionContext) marshalNPayloadDigest2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigest(ctx context.Context, sel ast.SelectionSet, v *ent.PayloadDigest) 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") @@ -10464,12 +10953,12 @@ func (ec *executionContext) marshalNPayloadDigest2ᚖgithubᚗcomᚋtestifysec return ec._PayloadDigest(ctx, sel, v) } -func (ec *executionContext) unmarshalNPayloadDigestWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigestWhereInput(ctx context.Context, v interface{}) (*ent.PayloadDigestWhereInput, error) { +func (ec *executionContext) unmarshalNPayloadDigestWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestWhereInput(ctx context.Context, v interface{}) (*ent.PayloadDigestWhereInput, error) { res, err := ec.unmarshalInputPayloadDigestWhereInput(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNSignature2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignature(ctx context.Context, sel ast.SelectionSet, v *ent.Signature) graphql.Marshaler { +func (ec *executionContext) marshalNSignature2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignature(ctx context.Context, sel ast.SelectionSet, v *ent.Signature) 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") @@ -10479,12 +10968,12 @@ func (ec *executionContext) marshalNSignature2ᚖgithubᚗcomᚋtestifysecᚋarc return ec._Signature(ctx, sel, v) } -func (ec *executionContext) unmarshalNSignatureWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignatureWhereInput(ctx context.Context, v interface{}) (*ent.SignatureWhereInput, error) { +func (ec *executionContext) unmarshalNSignatureWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureWhereInput(ctx context.Context, v interface{}) (*ent.SignatureWhereInput, error) { res, err := ec.unmarshalInputSignatureWhereInput(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNStatement2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatement(ctx context.Context, sel ast.SelectionSet, v *ent.Statement) graphql.Marshaler { +func (ec *executionContext) marshalNStatement2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatement(ctx context.Context, sel ast.SelectionSet, v *ent.Statement) 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") @@ -10494,7 +10983,7 @@ func (ec *executionContext) marshalNStatement2ᚖgithubᚗcomᚋtestifysecᚋarc return ec._Statement(ctx, sel, v) } -func (ec *executionContext) unmarshalNStatementWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatementWhereInput(ctx context.Context, v interface{}) (*ent.StatementWhereInput, error) { +func (ec *executionContext) unmarshalNStatementWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatementWhereInput(ctx context.Context, v interface{}) (*ent.StatementWhereInput, error) { res, err := ec.unmarshalInputStatementWhereInput(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } @@ -10514,11 +11003,11 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S return res } -func (ec *executionContext) marshalNSubjectConnection2githubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectConnection(ctx context.Context, sel ast.SelectionSet, v ent.SubjectConnection) graphql.Marshaler { +func (ec *executionContext) marshalNSubjectConnection2githubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectConnection(ctx context.Context, sel ast.SelectionSet, v ent.SubjectConnection) graphql.Marshaler { return ec._SubjectConnection(ctx, sel, &v) } -func (ec *executionContext) marshalNSubjectConnection2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectConnection(ctx context.Context, sel ast.SelectionSet, v *ent.SubjectConnection) graphql.Marshaler { +func (ec *executionContext) marshalNSubjectConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectConnection(ctx context.Context, sel ast.SelectionSet, v *ent.SubjectConnection) 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") @@ -10528,7 +11017,7 @@ func (ec *executionContext) marshalNSubjectConnection2ᚖgithubᚗcomᚋtestifys return ec._SubjectConnection(ctx, sel, v) } -func (ec *executionContext) marshalNSubjectDigest2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigest(ctx context.Context, sel ast.SelectionSet, v *ent.SubjectDigest) graphql.Marshaler { +func (ec *executionContext) marshalNSubjectDigest2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigest(ctx context.Context, sel ast.SelectionSet, v *ent.SubjectDigest) 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") @@ -10538,12 +11027,12 @@ func (ec *executionContext) marshalNSubjectDigest2ᚖgithubᚗcomᚋtestifysec return ec._SubjectDigest(ctx, sel, v) } -func (ec *executionContext) unmarshalNSubjectDigestWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigestWhereInput(ctx context.Context, v interface{}) (*ent.SubjectDigestWhereInput, error) { +func (ec *executionContext) unmarshalNSubjectDigestWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestWhereInput(ctx context.Context, v interface{}) (*ent.SubjectDigestWhereInput, error) { res, err := ec.unmarshalInputSubjectDigestWhereInput(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNSubjectWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectWhereInput(ctx context.Context, v interface{}) (*ent.SubjectWhereInput, error) { +func (ec *executionContext) unmarshalNSubjectWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectWhereInput(ctx context.Context, v interface{}) (*ent.SubjectWhereInput, error) { res, err := ec.unmarshalInputSubjectWhereInput(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } @@ -10563,7 +11052,7 @@ func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel as return res } -func (ec *executionContext) marshalNTimestamp2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestamp(ctx context.Context, sel ast.SelectionSet, v *ent.Timestamp) graphql.Marshaler { +func (ec *executionContext) marshalNTimestamp2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestamp(ctx context.Context, sel ast.SelectionSet, v *ent.Timestamp) 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") @@ -10573,7 +11062,7 @@ func (ec *executionContext) marshalNTimestamp2ᚖgithubᚗcomᚋtestifysecᚋarc return ec._Timestamp(ctx, sel, v) } -func (ec *executionContext) unmarshalNTimestampWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestampWhereInput(ctx context.Context, v interface{}) (*ent.TimestampWhereInput, error) { +func (ec *executionContext) unmarshalNTimestampWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampWhereInput(ctx context.Context, v interface{}) (*ent.TimestampWhereInput, error) { res, err := ec.unmarshalInputTimestampWhereInput(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } @@ -10831,7 +11320,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a return res } -func (ec *executionContext) marshalOAttestation2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.Attestation) graphql.Marshaler { +func (ec *executionContext) marshalOAttestation2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.Attestation) graphql.Marshaler { if v == nil { return graphql.Null } @@ -10858,7 +11347,7 @@ func (ec *executionContext) marshalOAttestation2ᚕᚖgithubᚗcomᚋtestifysec if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNAttestation2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestation(ctx, sel, v[i]) + ret[i] = ec.marshalNAttestation2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestation(ctx, sel, v[i]) } if isLen1 { f(i) @@ -10878,14 +11367,14 @@ func (ec *executionContext) marshalOAttestation2ᚕᚖgithubᚗcomᚋtestifysec return ret } -func (ec *executionContext) marshalOAttestationCollection2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollection(ctx context.Context, sel ast.SelectionSet, v *ent.AttestationCollection) graphql.Marshaler { +func (ec *executionContext) marshalOAttestationCollection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollection(ctx context.Context, sel ast.SelectionSet, v *ent.AttestationCollection) graphql.Marshaler { if v == nil { return graphql.Null } return ec._AttestationCollection(ctx, sel, v) } -func (ec *executionContext) unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.AttestationCollectionWhereInput, error) { +func (ec *executionContext) unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.AttestationCollectionWhereInput, error) { if v == nil { return nil, nil } @@ -10897,7 +11386,7 @@ func (ec *executionContext) unmarshalOAttestationCollectionWhereInput2ᚕᚖgith res := make([]*ent.AttestationCollectionWhereInput, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNAttestationCollectionWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollectionWhereInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalNAttestationCollectionWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollectionWhereInput(ctx, vSlice[i]) if err != nil { return nil, err } @@ -10905,7 +11394,7 @@ func (ec *executionContext) unmarshalOAttestationCollectionWhereInput2ᚕᚖgith return res, nil } -func (ec *executionContext) unmarshalOAttestationCollectionWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationCollectionWhereInput(ctx context.Context, v interface{}) (*ent.AttestationCollectionWhereInput, error) { +func (ec *executionContext) unmarshalOAttestationCollectionWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollectionWhereInput(ctx context.Context, v interface{}) (*ent.AttestationCollectionWhereInput, error) { if v == nil { return nil, nil } @@ -10913,7 +11402,90 @@ func (ec *executionContext) unmarshalOAttestationCollectionWhereInput2ᚖgithub return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.AttestationWhereInput, error) { +func (ec *executionContext) marshalOAttestationPolicy2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicy(ctx context.Context, sel ast.SelectionSet, v *ent.AttestationPolicy) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._AttestationPolicy(ctx, sel, v) +} + +func (ec *executionContext) marshalOAttestationPolicyEdge2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyEdge(ctx context.Context, sel ast.SelectionSet, v []*ent.AttestationPolicyEdge) 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.marshalOAttestationPolicyEdge2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOAttestationPolicyEdge2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyEdge(ctx context.Context, sel ast.SelectionSet, v *ent.AttestationPolicyEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._AttestationPolicyEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOAttestationPolicyWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.AttestationPolicyWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*ent.AttestationPolicyWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNAttestationPolicyWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOAttestationPolicyWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInput(ctx context.Context, v interface{}) (*ent.AttestationPolicyWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputAttestationPolicyWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.AttestationWhereInput, error) { if v == nil { return nil, nil } @@ -10925,7 +11497,7 @@ func (ec *executionContext) unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcom res := make([]*ent.AttestationWhereInput, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNAttestationWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationWhereInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalNAttestationWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInput(ctx, vSlice[i]) if err != nil { return nil, err } @@ -10933,7 +11505,7 @@ func (ec *executionContext) unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcom return res, nil } -func (ec *executionContext) unmarshalOAttestationWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐAttestationWhereInput(ctx context.Context, v interface{}) (*ent.AttestationWhereInput, error) { +func (ec *executionContext) unmarshalOAttestationWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInput(ctx context.Context, v interface{}) (*ent.AttestationWhereInput, error) { if v == nil { return nil, nil } @@ -10983,7 +11555,7 @@ func (ec *executionContext) marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCu return v } -func (ec *executionContext) marshalODsse2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.Dsse) graphql.Marshaler { +func (ec *executionContext) marshalODsse2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.Dsse) graphql.Marshaler { if v == nil { return graphql.Null } @@ -11010,7 +11582,7 @@ func (ec *executionContext) marshalODsse2ᚕᚖgithubᚗcomᚋtestifysecᚋarchi if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNDsse2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsse(ctx, sel, v[i]) + ret[i] = ec.marshalNDsse2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsse(ctx, sel, v[i]) } if isLen1 { f(i) @@ -11030,14 +11602,14 @@ func (ec *executionContext) marshalODsse2ᚕᚖgithubᚗcomᚋtestifysecᚋarchi return ret } -func (ec *executionContext) marshalODsse2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsse(ctx context.Context, sel ast.SelectionSet, v *ent.Dsse) graphql.Marshaler { +func (ec *executionContext) marshalODsse2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsse(ctx context.Context, sel ast.SelectionSet, v *ent.Dsse) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Dsse(ctx, sel, v) } -func (ec *executionContext) marshalODsseEdge2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseEdge(ctx context.Context, sel ast.SelectionSet, v []*ent.DsseEdge) graphql.Marshaler { +func (ec *executionContext) marshalODsseEdge2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseEdge(ctx context.Context, sel ast.SelectionSet, v []*ent.DsseEdge) graphql.Marshaler { if v == nil { return graphql.Null } @@ -11064,7 +11636,7 @@ func (ec *executionContext) marshalODsseEdge2ᚕᚖgithubᚗcomᚋtestifysecᚋa if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalODsseEdge2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseEdge(ctx, sel, v[i]) + ret[i] = ec.marshalODsseEdge2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseEdge(ctx, sel, v[i]) } if isLen1 { f(i) @@ -11078,14 +11650,14 @@ func (ec *executionContext) marshalODsseEdge2ᚕᚖgithubᚗcomᚋtestifysecᚋa return ret } -func (ec *executionContext) marshalODsseEdge2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseEdge(ctx context.Context, sel ast.SelectionSet, v *ent.DsseEdge) graphql.Marshaler { +func (ec *executionContext) marshalODsseEdge2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseEdge(ctx context.Context, sel ast.SelectionSet, v *ent.DsseEdge) graphql.Marshaler { if v == nil { return graphql.Null } return ec._DsseEdge(ctx, sel, v) } -func (ec *executionContext) unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.DsseWhereInput, error) { +func (ec *executionContext) unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.DsseWhereInput, error) { if v == nil { return nil, nil } @@ -11097,7 +11669,7 @@ func (ec *executionContext) unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋtestif res := make([]*ent.DsseWhereInput, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNDsseWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseWhereInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalNDsseWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInput(ctx, vSlice[i]) if err != nil { return nil, err } @@ -11105,7 +11677,7 @@ func (ec *executionContext) unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋtestif return res, nil } -func (ec *executionContext) unmarshalODsseWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐDsseWhereInput(ctx context.Context, v interface{}) (*ent.DsseWhereInput, error) { +func (ec *executionContext) unmarshalODsseWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInput(ctx context.Context, v interface{}) (*ent.DsseWhereInput, error) { if v == nil { return nil, nil } @@ -11183,14 +11755,14 @@ func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.Sele return res } -func (ec *executionContext) marshalONode2githubᚗcomᚋtestifysecᚋarchivistaᚋentᚐNoder(ctx context.Context, sel ast.SelectionSet, v ent.Noder) graphql.Marshaler { +func (ec *executionContext) marshalONode2githubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐNoder(ctx context.Context, sel ast.SelectionSet, v ent.Noder) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Node(ctx, sel, v) } -func (ec *executionContext) marshalOPayloadDigest2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigestᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.PayloadDigest) graphql.Marshaler { +func (ec *executionContext) marshalOPayloadDigest2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.PayloadDigest) graphql.Marshaler { if v == nil { return graphql.Null } @@ -11217,7 +11789,7 @@ func (ec *executionContext) marshalOPayloadDigest2ᚕᚖgithubᚗcomᚋtestifyse if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNPayloadDigest2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigest(ctx, sel, v[i]) + ret[i] = ec.marshalNPayloadDigest2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigest(ctx, sel, v[i]) } if isLen1 { f(i) @@ -11237,7 +11809,7 @@ func (ec *executionContext) marshalOPayloadDigest2ᚕᚖgithubᚗcomᚋtestifyse return ret } -func (ec *executionContext) unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigestWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.PayloadDigestWhereInput, error) { +func (ec *executionContext) unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.PayloadDigestWhereInput, error) { if v == nil { return nil, nil } @@ -11249,7 +11821,7 @@ func (ec *executionContext) unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcom res := make([]*ent.PayloadDigestWhereInput, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNPayloadDigestWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigestWhereInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalNPayloadDigestWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestWhereInput(ctx, vSlice[i]) if err != nil { return nil, err } @@ -11257,7 +11829,7 @@ func (ec *executionContext) unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcom return res, nil } -func (ec *executionContext) unmarshalOPayloadDigestWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐPayloadDigestWhereInput(ctx context.Context, v interface{}) (*ent.PayloadDigestWhereInput, error) { +func (ec *executionContext) unmarshalOPayloadDigestWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestWhereInput(ctx context.Context, v interface{}) (*ent.PayloadDigestWhereInput, error) { if v == nil { return nil, nil } @@ -11265,7 +11837,7 @@ func (ec *executionContext) unmarshalOPayloadDigestWhereInput2ᚖgithubᚗcomᚋ return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOSignature2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignatureᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.Signature) graphql.Marshaler { +func (ec *executionContext) marshalOSignature2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.Signature) graphql.Marshaler { if v == nil { return graphql.Null } @@ -11292,7 +11864,7 @@ func (ec *executionContext) marshalOSignature2ᚕᚖgithubᚗcomᚋtestifysecᚋ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNSignature2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignature(ctx, sel, v[i]) + ret[i] = ec.marshalNSignature2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignature(ctx, sel, v[i]) } if isLen1 { f(i) @@ -11312,14 +11884,14 @@ func (ec *executionContext) marshalOSignature2ᚕᚖgithubᚗcomᚋtestifysecᚋ return ret } -func (ec *executionContext) marshalOSignature2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignature(ctx context.Context, sel ast.SelectionSet, v *ent.Signature) graphql.Marshaler { +func (ec *executionContext) marshalOSignature2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignature(ctx context.Context, sel ast.SelectionSet, v *ent.Signature) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Signature(ctx, sel, v) } -func (ec *executionContext) unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignatureWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.SignatureWhereInput, error) { +func (ec *executionContext) unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.SignatureWhereInput, error) { if v == nil { return nil, nil } @@ -11331,7 +11903,7 @@ func (ec *executionContext) unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋt res := make([]*ent.SignatureWhereInput, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNSignatureWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignatureWhereInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalNSignatureWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureWhereInput(ctx, vSlice[i]) if err != nil { return nil, err } @@ -11339,7 +11911,7 @@ func (ec *executionContext) unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋt return res, nil } -func (ec *executionContext) unmarshalOSignatureWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSignatureWhereInput(ctx context.Context, v interface{}) (*ent.SignatureWhereInput, error) { +func (ec *executionContext) unmarshalOSignatureWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureWhereInput(ctx context.Context, v interface{}) (*ent.SignatureWhereInput, error) { if v == nil { return nil, nil } @@ -11347,14 +11919,14 @@ func (ec *executionContext) unmarshalOSignatureWhereInput2ᚖgithubᚗcomᚋtest return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOStatement2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatement(ctx context.Context, sel ast.SelectionSet, v *ent.Statement) graphql.Marshaler { +func (ec *executionContext) marshalOStatement2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatement(ctx context.Context, sel ast.SelectionSet, v *ent.Statement) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Statement(ctx, sel, v) } -func (ec *executionContext) unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatementWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.StatementWhereInput, error) { +func (ec *executionContext) unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatementWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.StatementWhereInput, error) { if v == nil { return nil, nil } @@ -11366,7 +11938,7 @@ func (ec *executionContext) unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋt res := make([]*ent.StatementWhereInput, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNStatementWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatementWhereInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalNStatementWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatementWhereInput(ctx, vSlice[i]) if err != nil { return nil, err } @@ -11374,7 +11946,7 @@ func (ec *executionContext) unmarshalOStatementWhereInput2ᚕᚖgithubᚗcomᚋt return res, nil } -func (ec *executionContext) unmarshalOStatementWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐStatementWhereInput(ctx context.Context, v interface{}) (*ent.StatementWhereInput, error) { +func (ec *executionContext) unmarshalOStatementWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatementWhereInput(ctx context.Context, v interface{}) (*ent.StatementWhereInput, error) { if v == nil { return nil, nil } @@ -11436,14 +12008,14 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as return res } -func (ec *executionContext) marshalOSubject2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubject(ctx context.Context, sel ast.SelectionSet, v *ent.Subject) graphql.Marshaler { +func (ec *executionContext) marshalOSubject2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubject(ctx context.Context, sel ast.SelectionSet, v *ent.Subject) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Subject(ctx, sel, v) } -func (ec *executionContext) marshalOSubjectDigest2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigestᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.SubjectDigest) graphql.Marshaler { +func (ec *executionContext) marshalOSubjectDigest2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.SubjectDigest) graphql.Marshaler { if v == nil { return graphql.Null } @@ -11470,7 +12042,7 @@ func (ec *executionContext) marshalOSubjectDigest2ᚕᚖgithubᚗcomᚋtestifyse if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNSubjectDigest2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigest(ctx, sel, v[i]) + ret[i] = ec.marshalNSubjectDigest2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigest(ctx, sel, v[i]) } if isLen1 { f(i) @@ -11490,7 +12062,7 @@ func (ec *executionContext) marshalOSubjectDigest2ᚕᚖgithubᚗcomᚋtestifyse return ret } -func (ec *executionContext) unmarshalOSubjectDigestWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigestWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.SubjectDigestWhereInput, error) { +func (ec *executionContext) unmarshalOSubjectDigestWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.SubjectDigestWhereInput, error) { if v == nil { return nil, nil } @@ -11502,7 +12074,7 @@ func (ec *executionContext) unmarshalOSubjectDigestWhereInput2ᚕᚖgithubᚗcom res := make([]*ent.SubjectDigestWhereInput, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNSubjectDigestWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigestWhereInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalNSubjectDigestWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestWhereInput(ctx, vSlice[i]) if err != nil { return nil, err } @@ -11510,7 +12082,7 @@ func (ec *executionContext) unmarshalOSubjectDigestWhereInput2ᚕᚖgithubᚗcom return res, nil } -func (ec *executionContext) unmarshalOSubjectDigestWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectDigestWhereInput(ctx context.Context, v interface{}) (*ent.SubjectDigestWhereInput, error) { +func (ec *executionContext) unmarshalOSubjectDigestWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestWhereInput(ctx context.Context, v interface{}) (*ent.SubjectDigestWhereInput, error) { if v == nil { return nil, nil } @@ -11518,7 +12090,7 @@ func (ec *executionContext) unmarshalOSubjectDigestWhereInput2ᚖgithubᚗcomᚋ return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOSubjectEdge2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectEdge(ctx context.Context, sel ast.SelectionSet, v []*ent.SubjectEdge) graphql.Marshaler { +func (ec *executionContext) marshalOSubjectEdge2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectEdge(ctx context.Context, sel ast.SelectionSet, v []*ent.SubjectEdge) graphql.Marshaler { if v == nil { return graphql.Null } @@ -11545,7 +12117,7 @@ func (ec *executionContext) marshalOSubjectEdge2ᚕᚖgithubᚗcomᚋtestifysec if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOSubjectEdge2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectEdge(ctx, sel, v[i]) + ret[i] = ec.marshalOSubjectEdge2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectEdge(ctx, sel, v[i]) } if isLen1 { f(i) @@ -11559,14 +12131,14 @@ func (ec *executionContext) marshalOSubjectEdge2ᚕᚖgithubᚗcomᚋtestifysec return ret } -func (ec *executionContext) marshalOSubjectEdge2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectEdge(ctx context.Context, sel ast.SelectionSet, v *ent.SubjectEdge) graphql.Marshaler { +func (ec *executionContext) marshalOSubjectEdge2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectEdge(ctx context.Context, sel ast.SelectionSet, v *ent.SubjectEdge) graphql.Marshaler { if v == nil { return graphql.Null } return ec._SubjectEdge(ctx, sel, v) } -func (ec *executionContext) unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.SubjectWhereInput, error) { +func (ec *executionContext) unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.SubjectWhereInput, error) { if v == nil { return nil, nil } @@ -11578,7 +12150,7 @@ func (ec *executionContext) unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋtes res := make([]*ent.SubjectWhereInput, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNSubjectWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectWhereInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalNSubjectWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectWhereInput(ctx, vSlice[i]) if err != nil { return nil, err } @@ -11586,7 +12158,7 @@ func (ec *executionContext) unmarshalOSubjectWhereInput2ᚕᚖgithubᚗcomᚋtes return res, nil } -func (ec *executionContext) unmarshalOSubjectWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐSubjectWhereInput(ctx context.Context, v interface{}) (*ent.SubjectWhereInput, error) { +func (ec *executionContext) unmarshalOSubjectWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectWhereInput(ctx context.Context, v interface{}) (*ent.SubjectWhereInput, error) { if v == nil { return nil, nil } @@ -11648,7 +12220,7 @@ func (ec *executionContext) marshalOTime2ᚖtimeᚐTime(ctx context.Context, sel return res } -func (ec *executionContext) marshalOTimestamp2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestampᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.Timestamp) graphql.Marshaler { +func (ec *executionContext) marshalOTimestamp2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.Timestamp) graphql.Marshaler { if v == nil { return graphql.Null } @@ -11675,7 +12247,7 @@ func (ec *executionContext) marshalOTimestamp2ᚕᚖgithubᚗcomᚋtestifysecᚋ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNTimestamp2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestamp(ctx, sel, v[i]) + ret[i] = ec.marshalNTimestamp2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestamp(ctx, sel, v[i]) } if isLen1 { f(i) @@ -11695,7 +12267,7 @@ func (ec *executionContext) marshalOTimestamp2ᚕᚖgithubᚗcomᚋtestifysecᚋ return ret } -func (ec *executionContext) unmarshalOTimestampWhereInput2ᚕᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestampWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.TimestampWhereInput, error) { +func (ec *executionContext) unmarshalOTimestampWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.TimestampWhereInput, error) { if v == nil { return nil, nil } @@ -11707,7 +12279,7 @@ func (ec *executionContext) unmarshalOTimestampWhereInput2ᚕᚖgithubᚗcomᚋt res := make([]*ent.TimestampWhereInput, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNTimestampWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestampWhereInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalNTimestampWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampWhereInput(ctx, vSlice[i]) if err != nil { return nil, err } @@ -11715,7 +12287,7 @@ func (ec *executionContext) unmarshalOTimestampWhereInput2ᚕᚖgithubᚗcomᚋt return res, nil } -func (ec *executionContext) unmarshalOTimestampWhereInput2ᚖgithubᚗcomᚋtestifysecᚋarchivistaᚋentᚐTimestampWhereInput(ctx context.Context, v interface{}) (*ent.TimestampWhereInput, error) { +func (ec *executionContext) unmarshalOTimestampWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampWhereInput(ctx context.Context, v interface{}) (*ent.TimestampWhereInput, error) { if v == nil { return nil, nil }