diff --git a/cmd/archivista/load_modules.go b/cmd/archivista/load_modules.go new file mode 100644 index 00000000..f52b3570 --- /dev/null +++ b/cmd/archivista/load_modules.go @@ -0,0 +1,18 @@ +// 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 main + +import ( + _ "github.com/in-toto/archivista/pkg/metadatastorage/attestationcollection/git_parser" +) diff --git a/ent.graphql b/ent.graphql index 3c8ffa72..fd12b96c 100644 --- a/ent.graphql +++ b/ent.graphql @@ -4,6 +4,7 @@ type Attestation implements Node { id: ID! type: String! attestationCollection: AttestationCollection! + gitAttestation: GitAttestation } type AttestationCollection implements Node { id: ID! @@ -173,6 +174,11 @@ input AttestationWhereInput { """ hasAttestationCollection: Boolean hasAttestationCollectionWith: [AttestationCollectionWhereInput!] + """ + git_attestation edge predicates + """ + hasGitAttestation: Boolean + hasGitAttestationWith: [GitAttestationWhereInput!] } """ Define a Relay Cursor type: @@ -284,6 +290,226 @@ input DsseWhereInput { hasPayloadDigests: Boolean hasPayloadDigestsWith: [PayloadDigestWhereInput!] } +type GitAttestation implements Node { + id: ID! + commitHash: String! + author: String! + authorEmail: String! + committerName: String! + committerEmail: String! + commitDate: String! + commitMessage: String! + status: [String!]! + commitType: String! + commitDigest: String! + signature: String! + parentHashes: [String!]! + treeHash: String! + refs: [String!]! + remotes: [String!]! + attestation: Attestation! +} +""" +GitAttestationWhereInput is used for filtering GitAttestation objects. +Input was generated by ent. +""" +input GitAttestationWhereInput { + not: GitAttestationWhereInput + and: [GitAttestationWhereInput!] + or: [GitAttestationWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """ + commit_hash field predicates + """ + commitHash: String + commitHashNEQ: String + commitHashIn: [String!] + commitHashNotIn: [String!] + commitHashGT: String + commitHashGTE: String + commitHashLT: String + commitHashLTE: String + commitHashContains: String + commitHashHasPrefix: String + commitHashHasSuffix: String + commitHashEqualFold: String + commitHashContainsFold: String + """ + author field predicates + """ + author: String + authorNEQ: String + authorIn: [String!] + authorNotIn: [String!] + authorGT: String + authorGTE: String + authorLT: String + authorLTE: String + authorContains: String + authorHasPrefix: String + authorHasSuffix: String + authorEqualFold: String + authorContainsFold: String + """ + author_email field predicates + """ + authorEmail: String + authorEmailNEQ: String + authorEmailIn: [String!] + authorEmailNotIn: [String!] + authorEmailGT: String + authorEmailGTE: String + authorEmailLT: String + authorEmailLTE: String + authorEmailContains: String + authorEmailHasPrefix: String + authorEmailHasSuffix: String + authorEmailEqualFold: String + authorEmailContainsFold: String + """ + committer_name field predicates + """ + committerName: String + committerNameNEQ: String + committerNameIn: [String!] + committerNameNotIn: [String!] + committerNameGT: String + committerNameGTE: String + committerNameLT: String + committerNameLTE: String + committerNameContains: String + committerNameHasPrefix: String + committerNameHasSuffix: String + committerNameEqualFold: String + committerNameContainsFold: String + """ + committer_email field predicates + """ + committerEmail: String + committerEmailNEQ: String + committerEmailIn: [String!] + committerEmailNotIn: [String!] + committerEmailGT: String + committerEmailGTE: String + committerEmailLT: String + committerEmailLTE: String + committerEmailContains: String + committerEmailHasPrefix: String + committerEmailHasSuffix: String + committerEmailEqualFold: String + committerEmailContainsFold: String + """ + commit_date field predicates + """ + commitDate: String + commitDateNEQ: String + commitDateIn: [String!] + commitDateNotIn: [String!] + commitDateGT: String + commitDateGTE: String + commitDateLT: String + commitDateLTE: String + commitDateContains: String + commitDateHasPrefix: String + commitDateHasSuffix: String + commitDateEqualFold: String + commitDateContainsFold: String + """ + commit_message field predicates + """ + commitMessage: String + commitMessageNEQ: String + commitMessageIn: [String!] + commitMessageNotIn: [String!] + commitMessageGT: String + commitMessageGTE: String + commitMessageLT: String + commitMessageLTE: String + commitMessageContains: String + commitMessageHasPrefix: String + commitMessageHasSuffix: String + commitMessageEqualFold: String + commitMessageContainsFold: String + """ + commit_type field predicates + """ + commitType: String + commitTypeNEQ: String + commitTypeIn: [String!] + commitTypeNotIn: [String!] + commitTypeGT: String + commitTypeGTE: String + commitTypeLT: String + commitTypeLTE: String + commitTypeContains: String + commitTypeHasPrefix: String + commitTypeHasSuffix: String + commitTypeEqualFold: String + commitTypeContainsFold: String + """ + commit_digest field predicates + """ + commitDigest: String + commitDigestNEQ: String + commitDigestIn: [String!] + commitDigestNotIn: [String!] + commitDigestGT: String + commitDigestGTE: String + commitDigestLT: String + commitDigestLTE: String + commitDigestContains: String + commitDigestHasPrefix: String + commitDigestHasSuffix: String + commitDigestEqualFold: String + commitDigestContainsFold: String + """ + signature field predicates + """ + signature: String + signatureNEQ: String + signatureIn: [String!] + signatureNotIn: [String!] + signatureGT: String + signatureGTE: String + signatureLT: String + signatureLTE: String + signatureContains: String + signatureHasPrefix: String + signatureHasSuffix: String + signatureEqualFold: String + signatureContainsFold: String + """ + tree_hash field predicates + """ + treeHash: String + treeHashNEQ: String + treeHashIn: [String!] + treeHashNotIn: [String!] + treeHashGT: String + treeHashGTE: String + treeHashLT: String + treeHashLTE: String + treeHashContains: String + treeHashHasPrefix: String + treeHashHasSuffix: String + treeHashEqualFold: String + treeHashContainsFold: String + """ + attestation edge predicates + """ + hasAttestation: Boolean + hasAttestationWith: [AttestationWhereInput!] +} """ An object with an ID. Follows the [Relay Global Object Identification Specification](https://relay.dev/graphql/objectidentification.htm) diff --git a/ent.resolvers.go b/ent.resolvers.go index df8beee0..ce9acfc9 100644 --- a/ent.resolvers.go +++ b/ent.resolvers.go @@ -2,7 +2,7 @@ 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.47 +// Code generated by github.com/99designs/gqlgen version v0.17.48 import ( "context" diff --git a/ent/attestation.go b/ent/attestation.go index 051fd8f6..230974ab 100644 --- a/ent/attestation.go +++ b/ent/attestation.go @@ -11,6 +11,7 @@ import ( "github.com/google/uuid" "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/gitattestation" ) // Attestation is the model entity for the Attestation schema. @@ -31,11 +32,13 @@ type Attestation struct { type AttestationEdges struct { // AttestationCollection holds the value of the attestation_collection edge. AttestationCollection *AttestationCollection `json:"attestation_collection,omitempty"` + // GitAttestation holds the value of the git_attestation edge. + GitAttestation *GitAttestation `json:"git_attestation,omitempty"` // loadedTypes holds the information for reporting if a // type was loaded (or requested) in eager-loading or not. - loadedTypes [1]bool + loadedTypes [2]bool // totalCount holds the count of the edges above. - totalCount [1]map[string]int + totalCount [2]map[string]int } // AttestationCollectionOrErr returns the AttestationCollection value or an error if the edge @@ -49,6 +52,17 @@ func (e AttestationEdges) AttestationCollectionOrErr() (*AttestationCollection, return nil, &NotLoadedError{edge: "attestation_collection"} } +// GitAttestationOrErr returns the GitAttestation value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e AttestationEdges) GitAttestationOrErr() (*GitAttestation, error) { + if e.GitAttestation != nil { + return e.GitAttestation, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: gitattestation.Label} + } + return nil, &NotLoadedError{edge: "git_attestation"} +} + // scanValues returns the types for scanning values from sql.Rows. func (*Attestation) scanValues(columns []string) ([]any, error) { values := make([]any, len(columns)) @@ -112,6 +126,11 @@ func (a *Attestation) QueryAttestationCollection() *AttestationCollectionQuery { return NewAttestationClient(a.config).QueryAttestationCollection(a) } +// QueryGitAttestation queries the "git_attestation" edge of the Attestation entity. +func (a *Attestation) QueryGitAttestation() *GitAttestationQuery { + return NewAttestationClient(a.config).QueryGitAttestation(a) +} + // Update returns a builder for updating this Attestation. // Note that you need to call Attestation.Unwrap() before calling this method if this Attestation // was returned from a transaction, and the transaction was committed or rolled back. diff --git a/ent/attestation/attestation.go b/ent/attestation/attestation.go index 916d0d8b..f6ec74cc 100644 --- a/ent/attestation/attestation.go +++ b/ent/attestation/attestation.go @@ -17,6 +17,8 @@ const ( FieldType = "type" // EdgeAttestationCollection holds the string denoting the attestation_collection edge name in mutations. EdgeAttestationCollection = "attestation_collection" + // EdgeGitAttestation holds the string denoting the git_attestation edge name in mutations. + EdgeGitAttestation = "git_attestation" // Table holds the table name of the attestation in the database. Table = "attestations" // AttestationCollectionTable is the table that holds the attestation_collection relation/edge. @@ -26,6 +28,13 @@ const ( AttestationCollectionInverseTable = "attestation_collections" // AttestationCollectionColumn is the table column denoting the attestation_collection relation/edge. AttestationCollectionColumn = "attestation_collection_attestations" + // GitAttestationTable is the table that holds the git_attestation relation/edge. + GitAttestationTable = "git_attestations" + // GitAttestationInverseTable is the table name for the GitAttestation entity. + // It exists in this package in order to avoid circular dependency with the "gitattestation" package. + GitAttestationInverseTable = "git_attestations" + // GitAttestationColumn is the table column denoting the git_attestation relation/edge. + GitAttestationColumn = "attestation_git_attestation" ) // Columns holds all SQL columns for attestation fields. @@ -81,6 +90,13 @@ func ByAttestationCollectionField(field string, opts ...sql.OrderTermOption) Ord sqlgraph.OrderByNeighborTerms(s, newAttestationCollectionStep(), sql.OrderByField(field, opts...)) } } + +// ByGitAttestationField orders the results by git_attestation field. +func ByGitAttestationField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newGitAttestationStep(), sql.OrderByField(field, opts...)) + } +} func newAttestationCollectionStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), @@ -88,3 +104,10 @@ func newAttestationCollectionStep() *sqlgraph.Step { sqlgraph.Edge(sqlgraph.M2O, true, AttestationCollectionTable, AttestationCollectionColumn), ) } +func newGitAttestationStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(GitAttestationInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, GitAttestationTable, GitAttestationColumn), + ) +} diff --git a/ent/attestation/where.go b/ent/attestation/where.go index be3532c1..60072a8c 100644 --- a/ent/attestation/where.go +++ b/ent/attestation/where.go @@ -147,6 +147,29 @@ func HasAttestationCollectionWith(preds ...predicate.AttestationCollection) pred }) } +// HasGitAttestation applies the HasEdge predicate on the "git_attestation" edge. +func HasGitAttestation() predicate.Attestation { + return predicate.Attestation(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, GitAttestationTable, GitAttestationColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasGitAttestationWith applies the HasEdge predicate on the "git_attestation" edge with a given conditions (other predicates). +func HasGitAttestationWith(preds ...predicate.GitAttestation) predicate.Attestation { + return predicate.Attestation(func(s *sql.Selector) { + step := newGitAttestationStep() + 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.Attestation) predicate.Attestation { return predicate.Attestation(sql.AndPredicates(predicates...)) diff --git a/ent/attestation_create.go b/ent/attestation_create.go index d3233cfd..e1c79ee6 100644 --- a/ent/attestation_create.go +++ b/ent/attestation_create.go @@ -12,6 +12,7 @@ import ( "github.com/google/uuid" "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/gitattestation" ) // AttestationCreate is the builder for creating a Attestation entity. @@ -52,6 +53,25 @@ func (ac *AttestationCreate) SetAttestationCollection(a *AttestationCollection) return ac.SetAttestationCollectionID(a.ID) } +// SetGitAttestationID sets the "git_attestation" edge to the GitAttestation entity by ID. +func (ac *AttestationCreate) SetGitAttestationID(id uuid.UUID) *AttestationCreate { + ac.mutation.SetGitAttestationID(id) + return ac +} + +// SetNillableGitAttestationID sets the "git_attestation" edge to the GitAttestation entity by ID if the given value is not nil. +func (ac *AttestationCreate) SetNillableGitAttestationID(id *uuid.UUID) *AttestationCreate { + if id != nil { + ac = ac.SetGitAttestationID(*id) + } + return ac +} + +// SetGitAttestation sets the "git_attestation" edge to the GitAttestation entity. +func (ac *AttestationCreate) SetGitAttestation(g *GitAttestation) *AttestationCreate { + return ac.SetGitAttestationID(g.ID) +} + // Mutation returns the AttestationMutation object of the builder. func (ac *AttestationCreate) Mutation() *AttestationMutation { return ac.mutation @@ -162,6 +182,22 @@ func (ac *AttestationCreate) createSpec() (*Attestation, *sqlgraph.CreateSpec) { _node.attestation_collection_attestations = &nodes[0] _spec.Edges = append(_spec.Edges, edge) } + if nodes := ac.mutation.GitAttestationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: attestation.GitAttestationTable, + Columns: []string{attestation.GitAttestationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(gitattestation.FieldID, field.TypeUUID), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } return _node, _spec } diff --git a/ent/attestation_query.go b/ent/attestation_query.go index c85b962b..6bf2c99a 100644 --- a/ent/attestation_query.go +++ b/ent/attestation_query.go @@ -4,6 +4,7 @@ package ent import ( "context" + "database/sql/driver" "fmt" "math" @@ -13,6 +14,7 @@ import ( "github.com/google/uuid" "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/gitattestation" "github.com/in-toto/archivista/ent/predicate" ) @@ -24,6 +26,7 @@ type AttestationQuery struct { inters []Interceptor predicates []predicate.Attestation withAttestationCollection *AttestationCollectionQuery + withGitAttestation *GitAttestationQuery withFKs bool modifiers []func(*sql.Selector) loadTotal []func(context.Context, []*Attestation) error @@ -85,6 +88,28 @@ func (aq *AttestationQuery) QueryAttestationCollection() *AttestationCollectionQ return query } +// QueryGitAttestation chains the current query on the "git_attestation" edge. +func (aq *AttestationQuery) QueryGitAttestation() *GitAttestationQuery { + query := (&GitAttestationClient{config: aq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := aq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := aq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(attestation.Table, attestation.FieldID, selector), + sqlgraph.To(gitattestation.Table, gitattestation.FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, attestation.GitAttestationTable, attestation.GitAttestationColumn), + ) + fromU = sqlgraph.SetNeighbors(aq.driver.Dialect(), step) + return fromU, nil + } + return query +} + // First returns the first Attestation entity from the query. // Returns a *NotFoundError when no Attestation was found. func (aq *AttestationQuery) First(ctx context.Context) (*Attestation, error) { @@ -278,6 +303,7 @@ func (aq *AttestationQuery) Clone() *AttestationQuery { inters: append([]Interceptor{}, aq.inters...), predicates: append([]predicate.Attestation{}, aq.predicates...), withAttestationCollection: aq.withAttestationCollection.Clone(), + withGitAttestation: aq.withGitAttestation.Clone(), // clone intermediate query. sql: aq.sql.Clone(), path: aq.path, @@ -295,6 +321,17 @@ func (aq *AttestationQuery) WithAttestationCollection(opts ...func(*AttestationC return aq } +// WithGitAttestation tells the query-builder to eager-load the nodes that are connected to +// the "git_attestation" edge. The optional arguments are used to configure the query builder of the edge. +func (aq *AttestationQuery) WithGitAttestation(opts ...func(*GitAttestationQuery)) *AttestationQuery { + query := (&GitAttestationClient{config: aq.config}).Query() + for _, opt := range opts { + opt(query) + } + aq.withGitAttestation = query + return aq +} + // 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. // @@ -374,8 +411,9 @@ func (aq *AttestationQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]* nodes = []*Attestation{} withFKs = aq.withFKs _spec = aq.querySpec() - loadedTypes = [1]bool{ + loadedTypes = [2]bool{ aq.withAttestationCollection != nil, + aq.withGitAttestation != nil, } ) if aq.withAttestationCollection != nil { @@ -411,6 +449,12 @@ func (aq *AttestationQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]* return nil, err } } + if query := aq.withGitAttestation; query != nil { + if err := aq.loadGitAttestation(ctx, query, nodes, nil, + func(n *Attestation, e *GitAttestation) { n.Edges.GitAttestation = e }); err != nil { + return nil, err + } + } for i := range aq.loadTotal { if err := aq.loadTotal[i](ctx, nodes); err != nil { return nil, err @@ -451,6 +495,34 @@ func (aq *AttestationQuery) loadAttestationCollection(ctx context.Context, query } return nil } +func (aq *AttestationQuery) loadGitAttestation(ctx context.Context, query *GitAttestationQuery, nodes []*Attestation, init func(*Attestation), assign func(*Attestation, *GitAttestation)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[uuid.UUID]*Attestation) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + } + query.withFKs = true + query.Where(predicate.GitAttestation(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(attestation.GitAttestationColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.attestation_git_attestation + if fk == nil { + return fmt.Errorf(`foreign-key "attestation_git_attestation" is nil for node %v`, n.ID) + } + node, ok := nodeids[*fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "attestation_git_attestation" returned %v for node %v`, *fk, n.ID) + } + assign(node, n) + } + return nil +} func (aq *AttestationQuery) sqlCount(ctx context.Context) (int, error) { _spec := aq.querySpec() diff --git a/ent/attestation_update.go b/ent/attestation_update.go index 08d5d1e4..754d48d1 100644 --- a/ent/attestation_update.go +++ b/ent/attestation_update.go @@ -13,6 +13,7 @@ import ( "github.com/google/uuid" "github.com/in-toto/archivista/ent/attestation" "github.com/in-toto/archivista/ent/attestationcollection" + "github.com/in-toto/archivista/ent/gitattestation" "github.com/in-toto/archivista/ent/predicate" ) @@ -54,6 +55,25 @@ func (au *AttestationUpdate) SetAttestationCollection(a *AttestationCollection) return au.SetAttestationCollectionID(a.ID) } +// SetGitAttestationID sets the "git_attestation" edge to the GitAttestation entity by ID. +func (au *AttestationUpdate) SetGitAttestationID(id uuid.UUID) *AttestationUpdate { + au.mutation.SetGitAttestationID(id) + return au +} + +// SetNillableGitAttestationID sets the "git_attestation" edge to the GitAttestation entity by ID if the given value is not nil. +func (au *AttestationUpdate) SetNillableGitAttestationID(id *uuid.UUID) *AttestationUpdate { + if id != nil { + au = au.SetGitAttestationID(*id) + } + return au +} + +// SetGitAttestation sets the "git_attestation" edge to the GitAttestation entity. +func (au *AttestationUpdate) SetGitAttestation(g *GitAttestation) *AttestationUpdate { + return au.SetGitAttestationID(g.ID) +} + // Mutation returns the AttestationMutation object of the builder. func (au *AttestationUpdate) Mutation() *AttestationMutation { return au.mutation @@ -65,6 +85,12 @@ func (au *AttestationUpdate) ClearAttestationCollection() *AttestationUpdate { return au } +// ClearGitAttestation clears the "git_attestation" edge to the GitAttestation entity. +func (au *AttestationUpdate) ClearGitAttestation() *AttestationUpdate { + au.mutation.ClearGitAttestation() + return au +} + // Save executes the query and returns the number of nodes affected by the update operation. func (au *AttestationUpdate) Save(ctx context.Context) (int, error) { return withHooks(ctx, au.sqlSave, au.mutation, au.hooks) @@ -149,6 +175,35 @@ func (au *AttestationUpdate) sqlSave(ctx context.Context) (n int, err error) { } _spec.Edges.Add = append(_spec.Edges.Add, edge) } + if au.mutation.GitAttestationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: attestation.GitAttestationTable, + Columns: []string{attestation.GitAttestationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(gitattestation.FieldID, field.TypeUUID), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := au.mutation.GitAttestationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: attestation.GitAttestationTable, + Columns: []string{attestation.GitAttestationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(gitattestation.FieldID, field.TypeUUID), + }, + } + 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, au.driver, _spec); err != nil { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{attestation.Label} @@ -194,6 +249,25 @@ func (auo *AttestationUpdateOne) SetAttestationCollection(a *AttestationCollecti return auo.SetAttestationCollectionID(a.ID) } +// SetGitAttestationID sets the "git_attestation" edge to the GitAttestation entity by ID. +func (auo *AttestationUpdateOne) SetGitAttestationID(id uuid.UUID) *AttestationUpdateOne { + auo.mutation.SetGitAttestationID(id) + return auo +} + +// SetNillableGitAttestationID sets the "git_attestation" edge to the GitAttestation entity by ID if the given value is not nil. +func (auo *AttestationUpdateOne) SetNillableGitAttestationID(id *uuid.UUID) *AttestationUpdateOne { + if id != nil { + auo = auo.SetGitAttestationID(*id) + } + return auo +} + +// SetGitAttestation sets the "git_attestation" edge to the GitAttestation entity. +func (auo *AttestationUpdateOne) SetGitAttestation(g *GitAttestation) *AttestationUpdateOne { + return auo.SetGitAttestationID(g.ID) +} + // Mutation returns the AttestationMutation object of the builder. func (auo *AttestationUpdateOne) Mutation() *AttestationMutation { return auo.mutation @@ -205,6 +279,12 @@ func (auo *AttestationUpdateOne) ClearAttestationCollection() *AttestationUpdate return auo } +// ClearGitAttestation clears the "git_attestation" edge to the GitAttestation entity. +func (auo *AttestationUpdateOne) ClearGitAttestation() *AttestationUpdateOne { + auo.mutation.ClearGitAttestation() + return auo +} + // Where appends a list predicates to the AttestationUpdate builder. func (auo *AttestationUpdateOne) Where(ps ...predicate.Attestation) *AttestationUpdateOne { auo.mutation.Where(ps...) @@ -319,6 +399,35 @@ func (auo *AttestationUpdateOne) sqlSave(ctx context.Context) (_node *Attestatio } _spec.Edges.Add = append(_spec.Edges.Add, edge) } + if auo.mutation.GitAttestationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: attestation.GitAttestationTable, + Columns: []string{attestation.GitAttestationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(gitattestation.FieldID, field.TypeUUID), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := auo.mutation.GitAttestationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: attestation.GitAttestationTable, + Columns: []string{attestation.GitAttestationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(gitattestation.FieldID, field.TypeUUID), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } _node = &Attestation{config: auo.config} _spec.Assign = _node.assignValues _spec.ScanValues = _node.scanValues diff --git a/ent/client.go b/ent/client.go index 3fde0f77..bffa0fcb 100644 --- a/ent/client.go +++ b/ent/client.go @@ -20,6 +20,7 @@ import ( "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/gitattestation" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/signature" "github.com/in-toto/archivista/ent/statement" @@ -41,6 +42,8 @@ type Client struct { AttestationPolicy *AttestationPolicyClient // Dsse is the client for interacting with the Dsse builders. Dsse *DsseClient + // GitAttestation is the client for interacting with the GitAttestation builders. + GitAttestation *GitAttestationClient // PayloadDigest is the client for interacting with the PayloadDigest builders. PayloadDigest *PayloadDigestClient // Signature is the client for interacting with the Signature builders. @@ -68,6 +71,7 @@ func (c *Client) init() { c.AttestationCollection = NewAttestationCollectionClient(c.config) c.AttestationPolicy = NewAttestationPolicyClient(c.config) c.Dsse = NewDsseClient(c.config) + c.GitAttestation = NewGitAttestationClient(c.config) c.PayloadDigest = NewPayloadDigestClient(c.config) c.Signature = NewSignatureClient(c.config) c.Statement = NewStatementClient(c.config) @@ -170,6 +174,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) { AttestationCollection: NewAttestationCollectionClient(cfg), AttestationPolicy: NewAttestationPolicyClient(cfg), Dsse: NewDsseClient(cfg), + GitAttestation: NewGitAttestationClient(cfg), PayloadDigest: NewPayloadDigestClient(cfg), Signature: NewSignatureClient(cfg), Statement: NewStatementClient(cfg), @@ -199,6 +204,7 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) AttestationCollection: NewAttestationCollectionClient(cfg), AttestationPolicy: NewAttestationPolicyClient(cfg), Dsse: NewDsseClient(cfg), + GitAttestation: NewGitAttestationClient(cfg), PayloadDigest: NewPayloadDigestClient(cfg), Signature: NewSignatureClient(cfg), Statement: NewStatementClient(cfg), @@ -235,8 +241,8 @@ func (c *Client) Close() error { func (c *Client) Use(hooks ...Hook) { for _, n := range []interface{ Use(...Hook) }{ c.Attestation, c.AttestationCollection, c.AttestationPolicy, c.Dsse, - c.PayloadDigest, c.Signature, c.Statement, c.Subject, c.SubjectDigest, - c.Timestamp, + c.GitAttestation, c.PayloadDigest, c.Signature, c.Statement, c.Subject, + c.SubjectDigest, c.Timestamp, } { n.Use(hooks...) } @@ -247,8 +253,8 @@ func (c *Client) Use(hooks ...Hook) { func (c *Client) Intercept(interceptors ...Interceptor) { for _, n := range []interface{ Intercept(...Interceptor) }{ c.Attestation, c.AttestationCollection, c.AttestationPolicy, c.Dsse, - c.PayloadDigest, c.Signature, c.Statement, c.Subject, c.SubjectDigest, - c.Timestamp, + c.GitAttestation, c.PayloadDigest, c.Signature, c.Statement, c.Subject, + c.SubjectDigest, c.Timestamp, } { n.Intercept(interceptors...) } @@ -265,6 +271,8 @@ func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) { return c.AttestationPolicy.mutate(ctx, m) case *DsseMutation: return c.Dsse.mutate(ctx, m) + case *GitAttestationMutation: + return c.GitAttestation.mutate(ctx, m) case *PayloadDigestMutation: return c.PayloadDigest.mutate(ctx, m) case *SignatureMutation: @@ -406,6 +414,22 @@ func (c *AttestationClient) QueryAttestationCollection(a *Attestation) *Attestat return query } +// QueryGitAttestation queries the git_attestation edge of a Attestation. +func (c *AttestationClient) QueryGitAttestation(a *Attestation) *GitAttestationQuery { + query := (&GitAttestationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := a.ID + step := sqlgraph.NewStep( + sqlgraph.From(attestation.Table, attestation.FieldID, id), + sqlgraph.To(gitattestation.Table, gitattestation.FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, attestation.GitAttestationTable, attestation.GitAttestationColumn), + ) + fromV = sqlgraph.Neighbors(a.driver.Dialect(), step) + return fromV, nil + } + return query +} + // Hooks returns the client hooks. func (c *AttestationClient) Hooks() []Hook { return c.hooks.Attestation @@ -926,6 +950,155 @@ func (c *DsseClient) mutate(ctx context.Context, m *DsseMutation) (Value, error) } } +// GitAttestationClient is a client for the GitAttestation schema. +type GitAttestationClient struct { + config +} + +// NewGitAttestationClient returns a client for the GitAttestation from the given config. +func NewGitAttestationClient(c config) *GitAttestationClient { + return &GitAttestationClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `gitattestation.Hooks(f(g(h())))`. +func (c *GitAttestationClient) Use(hooks ...Hook) { + c.hooks.GitAttestation = append(c.hooks.GitAttestation, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `gitattestation.Intercept(f(g(h())))`. +func (c *GitAttestationClient) Intercept(interceptors ...Interceptor) { + c.inters.GitAttestation = append(c.inters.GitAttestation, interceptors...) +} + +// Create returns a builder for creating a GitAttestation entity. +func (c *GitAttestationClient) Create() *GitAttestationCreate { + mutation := newGitAttestationMutation(c.config, OpCreate) + return &GitAttestationCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of GitAttestation entities. +func (c *GitAttestationClient) CreateBulk(builders ...*GitAttestationCreate) *GitAttestationCreateBulk { + return &GitAttestationCreateBulk{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 *GitAttestationClient) MapCreateBulk(slice any, setFunc func(*GitAttestationCreate, int)) *GitAttestationCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &GitAttestationCreateBulk{err: fmt.Errorf("calling to GitAttestationClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*GitAttestationCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &GitAttestationCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for GitAttestation. +func (c *GitAttestationClient) Update() *GitAttestationUpdate { + mutation := newGitAttestationMutation(c.config, OpUpdate) + return &GitAttestationUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *GitAttestationClient) UpdateOne(ga *GitAttestation) *GitAttestationUpdateOne { + mutation := newGitAttestationMutation(c.config, OpUpdateOne, withGitAttestation(ga)) + return &GitAttestationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *GitAttestationClient) UpdateOneID(id uuid.UUID) *GitAttestationUpdateOne { + mutation := newGitAttestationMutation(c.config, OpUpdateOne, withGitAttestationID(id)) + return &GitAttestationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for GitAttestation. +func (c *GitAttestationClient) Delete() *GitAttestationDelete { + mutation := newGitAttestationMutation(c.config, OpDelete) + return &GitAttestationDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *GitAttestationClient) DeleteOne(ga *GitAttestation) *GitAttestationDeleteOne { + return c.DeleteOneID(ga.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *GitAttestationClient) DeleteOneID(id uuid.UUID) *GitAttestationDeleteOne { + builder := c.Delete().Where(gitattestation.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &GitAttestationDeleteOne{builder} +} + +// Query returns a query builder for GitAttestation. +func (c *GitAttestationClient) Query() *GitAttestationQuery { + return &GitAttestationQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeGitAttestation}, + inters: c.Interceptors(), + } +} + +// Get returns a GitAttestation entity by its id. +func (c *GitAttestationClient) Get(ctx context.Context, id uuid.UUID) (*GitAttestation, error) { + return c.Query().Where(gitattestation.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *GitAttestationClient) GetX(ctx context.Context, id uuid.UUID) *GitAttestation { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryAttestation queries the attestation edge of a GitAttestation. +func (c *GitAttestationClient) QueryAttestation(ga *GitAttestation) *AttestationQuery { + query := (&AttestationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := ga.ID + step := sqlgraph.NewStep( + sqlgraph.From(gitattestation.Table, gitattestation.FieldID, id), + sqlgraph.To(attestation.Table, attestation.FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, gitattestation.AttestationTable, gitattestation.AttestationColumn), + ) + fromV = sqlgraph.Neighbors(ga.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *GitAttestationClient) Hooks() []Hook { + return c.hooks.GitAttestation +} + +// Interceptors returns the client interceptors. +func (c *GitAttestationClient) Interceptors() []Interceptor { + return c.inters.GitAttestation +} + +func (c *GitAttestationClient) mutate(ctx context.Context, m *GitAttestationMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&GitAttestationCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&GitAttestationUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&GitAttestationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&GitAttestationDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("ent: unknown GitAttestation mutation op: %q", m.Op()) + } +} + // PayloadDigestClient is a client for the PayloadDigest schema. type PayloadDigestClient struct { config @@ -1903,11 +2076,13 @@ func (c *TimestampClient) mutate(ctx context.Context, m *TimestampMutation) (Val // hooks and interceptors per client, for fast access. type ( hooks struct { - Attestation, AttestationCollection, AttestationPolicy, Dsse, PayloadDigest, - Signature, Statement, Subject, SubjectDigest, Timestamp []ent.Hook + Attestation, AttestationCollection, AttestationPolicy, Dsse, GitAttestation, + PayloadDigest, Signature, Statement, Subject, SubjectDigest, + Timestamp []ent.Hook } inters struct { - Attestation, AttestationCollection, AttestationPolicy, Dsse, PayloadDigest, - Signature, Statement, Subject, SubjectDigest, Timestamp []ent.Interceptor + Attestation, AttestationCollection, AttestationPolicy, Dsse, GitAttestation, + PayloadDigest, Signature, Statement, Subject, SubjectDigest, + Timestamp []ent.Interceptor } ) diff --git a/ent/ent.go b/ent/ent.go index a84a145b..9139f989 100644 --- a/ent/ent.go +++ b/ent/ent.go @@ -16,6 +16,7 @@ import ( "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/gitattestation" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/signature" "github.com/in-toto/archivista/ent/statement" @@ -86,6 +87,7 @@ func checkColumn(table, column string) error { attestationcollection.Table: attestationcollection.ValidColumn, attestationpolicy.Table: attestationpolicy.ValidColumn, dsse.Table: dsse.ValidColumn, + gitattestation.Table: gitattestation.ValidColumn, payloaddigest.Table: payloaddigest.ValidColumn, signature.Table: signature.ValidColumn, statement.Table: statement.ValidColumn, diff --git a/ent/gitattestation.go b/ent/gitattestation.go new file mode 100644 index 00000000..1c152b59 --- /dev/null +++ b/ent/gitattestation.go @@ -0,0 +1,310 @@ +// Code generated by ent, DO NOT EDIT. + +package ent + +import ( + "encoding/json" + "fmt" + "strings" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/google/uuid" + "github.com/in-toto/archivista/ent/attestation" + "github.com/in-toto/archivista/ent/gitattestation" +) + +// GitAttestation is the model entity for the GitAttestation schema. +type GitAttestation struct { + config `json:"-"` + // ID of the ent. + ID uuid.UUID `json:"id,omitempty"` + // CommitHash holds the value of the "commit_hash" field. + CommitHash string `json:"commit_hash,omitempty"` + // Author holds the value of the "author" field. + Author string `json:"author,omitempty"` + // AuthorEmail holds the value of the "author_email" field. + AuthorEmail string `json:"author_email,omitempty"` + // CommitterName holds the value of the "committer_name" field. + CommitterName string `json:"committer_name,omitempty"` + // CommitterEmail holds the value of the "committer_email" field. + CommitterEmail string `json:"committer_email,omitempty"` + // CommitDate holds the value of the "commit_date" field. + CommitDate string `json:"commit_date,omitempty"` + // CommitMessage holds the value of the "commit_message" field. + CommitMessage string `json:"commit_message,omitempty"` + // Status holds the value of the "status" field. + Status []string `json:"status,omitempty"` + // CommitType holds the value of the "commit_type" field. + CommitType string `json:"commit_type,omitempty"` + // CommitDigest holds the value of the "commit_digest" field. + CommitDigest string `json:"commit_digest,omitempty"` + // Signature holds the value of the "signature" field. + Signature string `json:"signature,omitempty"` + // ParentHashes holds the value of the "parent_hashes" field. + ParentHashes []string `json:"parent_hashes,omitempty"` + // TreeHash holds the value of the "tree_hash" field. + TreeHash string `json:"tree_hash,omitempty"` + // Refs holds the value of the "refs" field. + Refs []string `json:"refs,omitempty"` + // Remotes holds the value of the "remotes" field. + Remotes []string `json:"remotes,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the GitAttestationQuery when eager-loading is set. + Edges GitAttestationEdges `json:"edges"` + attestation_git_attestation *uuid.UUID + selectValues sql.SelectValues +} + +// GitAttestationEdges holds the relations/edges for other nodes in the graph. +type GitAttestationEdges struct { + // Attestation holds the value of the attestation edge. + Attestation *Attestation `json:"attestation,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 +} + +// AttestationOrErr returns the Attestation value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e GitAttestationEdges) AttestationOrErr() (*Attestation, error) { + if e.Attestation != nil { + return e.Attestation, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: attestation.Label} + } + return nil, &NotLoadedError{edge: "attestation"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*GitAttestation) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case gitattestation.FieldStatus, gitattestation.FieldParentHashes, gitattestation.FieldRefs, gitattestation.FieldRemotes: + values[i] = new([]byte) + case gitattestation.FieldCommitHash, gitattestation.FieldAuthor, gitattestation.FieldAuthorEmail, gitattestation.FieldCommitterName, gitattestation.FieldCommitterEmail, gitattestation.FieldCommitDate, gitattestation.FieldCommitMessage, gitattestation.FieldCommitType, gitattestation.FieldCommitDigest, gitattestation.FieldSignature, gitattestation.FieldTreeHash: + values[i] = new(sql.NullString) + case gitattestation.FieldID: + values[i] = new(uuid.UUID) + case gitattestation.ForeignKeys[0]: // attestation_git_attestation + values[i] = &sql.NullScanner{S: new(uuid.UUID)} + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the GitAttestation fields. +func (ga *GitAttestation) 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 gitattestation.FieldID: + if value, ok := values[i].(*uuid.UUID); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value != nil { + ga.ID = *value + } + case gitattestation.FieldCommitHash: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field commit_hash", values[i]) + } else if value.Valid { + ga.CommitHash = value.String + } + case gitattestation.FieldAuthor: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field author", values[i]) + } else if value.Valid { + ga.Author = value.String + } + case gitattestation.FieldAuthorEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field author_email", values[i]) + } else if value.Valid { + ga.AuthorEmail = value.String + } + case gitattestation.FieldCommitterName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field committer_name", values[i]) + } else if value.Valid { + ga.CommitterName = value.String + } + case gitattestation.FieldCommitterEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field committer_email", values[i]) + } else if value.Valid { + ga.CommitterEmail = value.String + } + case gitattestation.FieldCommitDate: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field commit_date", values[i]) + } else if value.Valid { + ga.CommitDate = value.String + } + case gitattestation.FieldCommitMessage: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field commit_message", values[i]) + } else if value.Valid { + ga.CommitMessage = value.String + } + case gitattestation.FieldStatus: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ga.Status); err != nil { + return fmt.Errorf("unmarshal field status: %w", err) + } + } + case gitattestation.FieldCommitType: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field commit_type", values[i]) + } else if value.Valid { + ga.CommitType = value.String + } + case gitattestation.FieldCommitDigest: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field commit_digest", values[i]) + } else if value.Valid { + ga.CommitDigest = value.String + } + case gitattestation.FieldSignature: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field signature", values[i]) + } else if value.Valid { + ga.Signature = value.String + } + case gitattestation.FieldParentHashes: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field parent_hashes", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ga.ParentHashes); err != nil { + return fmt.Errorf("unmarshal field parent_hashes: %w", err) + } + } + case gitattestation.FieldTreeHash: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field tree_hash", values[i]) + } else if value.Valid { + ga.TreeHash = value.String + } + case gitattestation.FieldRefs: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field refs", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ga.Refs); err != nil { + return fmt.Errorf("unmarshal field refs: %w", err) + } + } + case gitattestation.FieldRemotes: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field remotes", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ga.Remotes); err != nil { + return fmt.Errorf("unmarshal field remotes: %w", err) + } + } + case gitattestation.ForeignKeys[0]: + if value, ok := values[i].(*sql.NullScanner); !ok { + return fmt.Errorf("unexpected type %T for field attestation_git_attestation", values[i]) + } else if value.Valid { + ga.attestation_git_attestation = new(uuid.UUID) + *ga.attestation_git_attestation = *value.S.(*uuid.UUID) + } + default: + ga.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the GitAttestation. +// This includes values selected through modifiers, order, etc. +func (ga *GitAttestation) Value(name string) (ent.Value, error) { + return ga.selectValues.Get(name) +} + +// QueryAttestation queries the "attestation" edge of the GitAttestation entity. +func (ga *GitAttestation) QueryAttestation() *AttestationQuery { + return NewGitAttestationClient(ga.config).QueryAttestation(ga) +} + +// Update returns a builder for updating this GitAttestation. +// Note that you need to call GitAttestation.Unwrap() before calling this method if this GitAttestation +// was returned from a transaction, and the transaction was committed or rolled back. +func (ga *GitAttestation) Update() *GitAttestationUpdateOne { + return NewGitAttestationClient(ga.config).UpdateOne(ga) +} + +// Unwrap unwraps the GitAttestation 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 (ga *GitAttestation) Unwrap() *GitAttestation { + _tx, ok := ga.config.driver.(*txDriver) + if !ok { + panic("ent: GitAttestation is not a transactional entity") + } + ga.config.driver = _tx.drv + return ga +} + +// String implements the fmt.Stringer. +func (ga *GitAttestation) String() string { + var builder strings.Builder + builder.WriteString("GitAttestation(") + builder.WriteString(fmt.Sprintf("id=%v, ", ga.ID)) + builder.WriteString("commit_hash=") + builder.WriteString(ga.CommitHash) + builder.WriteString(", ") + builder.WriteString("author=") + builder.WriteString(ga.Author) + builder.WriteString(", ") + builder.WriteString("author_email=") + builder.WriteString(ga.AuthorEmail) + builder.WriteString(", ") + builder.WriteString("committer_name=") + builder.WriteString(ga.CommitterName) + builder.WriteString(", ") + builder.WriteString("committer_email=") + builder.WriteString(ga.CommitterEmail) + builder.WriteString(", ") + builder.WriteString("commit_date=") + builder.WriteString(ga.CommitDate) + builder.WriteString(", ") + builder.WriteString("commit_message=") + builder.WriteString(ga.CommitMessage) + builder.WriteString(", ") + builder.WriteString("status=") + builder.WriteString(fmt.Sprintf("%v", ga.Status)) + builder.WriteString(", ") + builder.WriteString("commit_type=") + builder.WriteString(ga.CommitType) + builder.WriteString(", ") + builder.WriteString("commit_digest=") + builder.WriteString(ga.CommitDigest) + builder.WriteString(", ") + builder.WriteString("signature=") + builder.WriteString(ga.Signature) + builder.WriteString(", ") + builder.WriteString("parent_hashes=") + builder.WriteString(fmt.Sprintf("%v", ga.ParentHashes)) + builder.WriteString(", ") + builder.WriteString("tree_hash=") + builder.WriteString(ga.TreeHash) + builder.WriteString(", ") + builder.WriteString("refs=") + builder.WriteString(fmt.Sprintf("%v", ga.Refs)) + builder.WriteString(", ") + builder.WriteString("remotes=") + builder.WriteString(fmt.Sprintf("%v", ga.Remotes)) + builder.WriteByte(')') + return builder.String() +} + +// GitAttestations is a parsable slice of GitAttestation. +type GitAttestations []*GitAttestation diff --git a/ent/gitattestation/gitattestation.go b/ent/gitattestation/gitattestation.go new file mode 100644 index 00000000..8ceaad06 --- /dev/null +++ b/ent/gitattestation/gitattestation.go @@ -0,0 +1,180 @@ +// Code generated by ent, DO NOT EDIT. + +package gitattestation + +import ( + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/google/uuid" +) + +const ( + // Label holds the string label denoting the gitattestation type in the database. + Label = "git_attestation" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCommitHash holds the string denoting the commit_hash field in the database. + FieldCommitHash = "commit_hash" + // FieldAuthor holds the string denoting the author field in the database. + FieldAuthor = "author" + // FieldAuthorEmail holds the string denoting the author_email field in the database. + FieldAuthorEmail = "author_email" + // FieldCommitterName holds the string denoting the committer_name field in the database. + FieldCommitterName = "committer_name" + // FieldCommitterEmail holds the string denoting the committer_email field in the database. + FieldCommitterEmail = "committer_email" + // FieldCommitDate holds the string denoting the commit_date field in the database. + FieldCommitDate = "commit_date" + // FieldCommitMessage holds the string denoting the commit_message field in the database. + FieldCommitMessage = "commit_message" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // FieldCommitType holds the string denoting the commit_type field in the database. + FieldCommitType = "commit_type" + // FieldCommitDigest holds the string denoting the commit_digest field in the database. + FieldCommitDigest = "commit_digest" + // FieldSignature holds the string denoting the signature field in the database. + FieldSignature = "signature" + // FieldParentHashes holds the string denoting the parent_hashes field in the database. + FieldParentHashes = "parent_hashes" + // FieldTreeHash holds the string denoting the tree_hash field in the database. + FieldTreeHash = "tree_hash" + // FieldRefs holds the string denoting the refs field in the database. + FieldRefs = "refs" + // FieldRemotes holds the string denoting the remotes field in the database. + FieldRemotes = "remotes" + // EdgeAttestation holds the string denoting the attestation edge name in mutations. + EdgeAttestation = "attestation" + // Table holds the table name of the gitattestation in the database. + Table = "git_attestations" + // AttestationTable is the table that holds the attestation relation/edge. + AttestationTable = "git_attestations" + // AttestationInverseTable is the table name for the Attestation entity. + // It exists in this package in order to avoid circular dependency with the "attestation" package. + AttestationInverseTable = "attestations" + // AttestationColumn is the table column denoting the attestation relation/edge. + AttestationColumn = "attestation_git_attestation" +) + +// Columns holds all SQL columns for gitattestation fields. +var Columns = []string{ + FieldID, + FieldCommitHash, + FieldAuthor, + FieldAuthorEmail, + FieldCommitterName, + FieldCommitterEmail, + FieldCommitDate, + FieldCommitMessage, + FieldStatus, + FieldCommitType, + FieldCommitDigest, + FieldSignature, + FieldParentHashes, + FieldTreeHash, + FieldRefs, + FieldRemotes, +} + +// ForeignKeys holds the SQL foreign-keys that are owned by the "git_attestations" +// table and are not defined as standalone fields in the schema. +var ForeignKeys = []string{ + "attestation_git_attestation", +} + +// 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 ( + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() uuid.UUID +) + +// OrderOption defines the ordering options for the GitAttestation 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() +} + +// ByCommitHash orders the results by the commit_hash field. +func ByCommitHash(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCommitHash, opts...).ToFunc() +} + +// ByAuthor orders the results by the author field. +func ByAuthor(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAuthor, opts...).ToFunc() +} + +// ByAuthorEmail orders the results by the author_email field. +func ByAuthorEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAuthorEmail, opts...).ToFunc() +} + +// ByCommitterName orders the results by the committer_name field. +func ByCommitterName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCommitterName, opts...).ToFunc() +} + +// ByCommitterEmail orders the results by the committer_email field. +func ByCommitterEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCommitterEmail, opts...).ToFunc() +} + +// ByCommitDate orders the results by the commit_date field. +func ByCommitDate(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCommitDate, opts...).ToFunc() +} + +// ByCommitMessage orders the results by the commit_message field. +func ByCommitMessage(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCommitMessage, opts...).ToFunc() +} + +// ByCommitType orders the results by the commit_type field. +func ByCommitType(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCommitType, opts...).ToFunc() +} + +// ByCommitDigest orders the results by the commit_digest field. +func ByCommitDigest(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCommitDigest, opts...).ToFunc() +} + +// BySignature orders the results by the signature field. +func BySignature(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSignature, opts...).ToFunc() +} + +// ByTreeHash orders the results by the tree_hash field. +func ByTreeHash(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTreeHash, opts...).ToFunc() +} + +// ByAttestationField orders the results by attestation field. +func ByAttestationField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newAttestationStep(), sql.OrderByField(field, opts...)) + } +} +func newAttestationStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(AttestationInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, AttestationTable, AttestationColumn), + ) +} diff --git a/ent/gitattestation/where.go b/ent/gitattestation/where.go new file mode 100644 index 00000000..dda2769f --- /dev/null +++ b/ent/gitattestation/where.go @@ -0,0 +1,863 @@ +// Code generated by ent, DO NOT EDIT. + +package gitattestation + +import ( + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/google/uuid" + "github.com/in-toto/archivista/ent/predicate" +) + +// ID filters vertices based on their ID field. +func ID(id uuid.UUID) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id uuid.UUID) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id uuid.UUID) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...uuid.UUID) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...uuid.UUID) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id uuid.UUID) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id uuid.UUID) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id uuid.UUID) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id uuid.UUID) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldID, id)) +} + +// CommitHash applies equality check predicate on the "commit_hash" field. It's identical to CommitHashEQ. +func CommitHash(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitHash, v)) +} + +// Author applies equality check predicate on the "author" field. It's identical to AuthorEQ. +func Author(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldAuthor, v)) +} + +// AuthorEmail applies equality check predicate on the "author_email" field. It's identical to AuthorEmailEQ. +func AuthorEmail(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldAuthorEmail, v)) +} + +// CommitterName applies equality check predicate on the "committer_name" field. It's identical to CommitterNameEQ. +func CommitterName(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitterName, v)) +} + +// CommitterEmail applies equality check predicate on the "committer_email" field. It's identical to CommitterEmailEQ. +func CommitterEmail(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitterEmail, v)) +} + +// CommitDate applies equality check predicate on the "commit_date" field. It's identical to CommitDateEQ. +func CommitDate(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitDate, v)) +} + +// CommitMessage applies equality check predicate on the "commit_message" field. It's identical to CommitMessageEQ. +func CommitMessage(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitMessage, v)) +} + +// CommitType applies equality check predicate on the "commit_type" field. It's identical to CommitTypeEQ. +func CommitType(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitType, v)) +} + +// CommitDigest applies equality check predicate on the "commit_digest" field. It's identical to CommitDigestEQ. +func CommitDigest(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitDigest, v)) +} + +// Signature applies equality check predicate on the "signature" field. It's identical to SignatureEQ. +func Signature(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldSignature, v)) +} + +// TreeHash applies equality check predicate on the "tree_hash" field. It's identical to TreeHashEQ. +func TreeHash(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldTreeHash, v)) +} + +// CommitHashEQ applies the EQ predicate on the "commit_hash" field. +func CommitHashEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitHash, v)) +} + +// CommitHashNEQ applies the NEQ predicate on the "commit_hash" field. +func CommitHashNEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldCommitHash, v)) +} + +// CommitHashIn applies the In predicate on the "commit_hash" field. +func CommitHashIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldCommitHash, vs...)) +} + +// CommitHashNotIn applies the NotIn predicate on the "commit_hash" field. +func CommitHashNotIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldCommitHash, vs...)) +} + +// CommitHashGT applies the GT predicate on the "commit_hash" field. +func CommitHashGT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldCommitHash, v)) +} + +// CommitHashGTE applies the GTE predicate on the "commit_hash" field. +func CommitHashGTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldCommitHash, v)) +} + +// CommitHashLT applies the LT predicate on the "commit_hash" field. +func CommitHashLT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldCommitHash, v)) +} + +// CommitHashLTE applies the LTE predicate on the "commit_hash" field. +func CommitHashLTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldCommitHash, v)) +} + +// CommitHashContains applies the Contains predicate on the "commit_hash" field. +func CommitHashContains(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContains(FieldCommitHash, v)) +} + +// CommitHashHasPrefix applies the HasPrefix predicate on the "commit_hash" field. +func CommitHashHasPrefix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasPrefix(FieldCommitHash, v)) +} + +// CommitHashHasSuffix applies the HasSuffix predicate on the "commit_hash" field. +func CommitHashHasSuffix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasSuffix(FieldCommitHash, v)) +} + +// CommitHashEqualFold applies the EqualFold predicate on the "commit_hash" field. +func CommitHashEqualFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEqualFold(FieldCommitHash, v)) +} + +// CommitHashContainsFold applies the ContainsFold predicate on the "commit_hash" field. +func CommitHashContainsFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContainsFold(FieldCommitHash, v)) +} + +// AuthorEQ applies the EQ predicate on the "author" field. +func AuthorEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldAuthor, v)) +} + +// AuthorNEQ applies the NEQ predicate on the "author" field. +func AuthorNEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldAuthor, v)) +} + +// AuthorIn applies the In predicate on the "author" field. +func AuthorIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldAuthor, vs...)) +} + +// AuthorNotIn applies the NotIn predicate on the "author" field. +func AuthorNotIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldAuthor, vs...)) +} + +// AuthorGT applies the GT predicate on the "author" field. +func AuthorGT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldAuthor, v)) +} + +// AuthorGTE applies the GTE predicate on the "author" field. +func AuthorGTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldAuthor, v)) +} + +// AuthorLT applies the LT predicate on the "author" field. +func AuthorLT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldAuthor, v)) +} + +// AuthorLTE applies the LTE predicate on the "author" field. +func AuthorLTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldAuthor, v)) +} + +// AuthorContains applies the Contains predicate on the "author" field. +func AuthorContains(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContains(FieldAuthor, v)) +} + +// AuthorHasPrefix applies the HasPrefix predicate on the "author" field. +func AuthorHasPrefix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasPrefix(FieldAuthor, v)) +} + +// AuthorHasSuffix applies the HasSuffix predicate on the "author" field. +func AuthorHasSuffix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasSuffix(FieldAuthor, v)) +} + +// AuthorEqualFold applies the EqualFold predicate on the "author" field. +func AuthorEqualFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEqualFold(FieldAuthor, v)) +} + +// AuthorContainsFold applies the ContainsFold predicate on the "author" field. +func AuthorContainsFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContainsFold(FieldAuthor, v)) +} + +// AuthorEmailEQ applies the EQ predicate on the "author_email" field. +func AuthorEmailEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldAuthorEmail, v)) +} + +// AuthorEmailNEQ applies the NEQ predicate on the "author_email" field. +func AuthorEmailNEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldAuthorEmail, v)) +} + +// AuthorEmailIn applies the In predicate on the "author_email" field. +func AuthorEmailIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldAuthorEmail, vs...)) +} + +// AuthorEmailNotIn applies the NotIn predicate on the "author_email" field. +func AuthorEmailNotIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldAuthorEmail, vs...)) +} + +// AuthorEmailGT applies the GT predicate on the "author_email" field. +func AuthorEmailGT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldAuthorEmail, v)) +} + +// AuthorEmailGTE applies the GTE predicate on the "author_email" field. +func AuthorEmailGTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldAuthorEmail, v)) +} + +// AuthorEmailLT applies the LT predicate on the "author_email" field. +func AuthorEmailLT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldAuthorEmail, v)) +} + +// AuthorEmailLTE applies the LTE predicate on the "author_email" field. +func AuthorEmailLTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldAuthorEmail, v)) +} + +// AuthorEmailContains applies the Contains predicate on the "author_email" field. +func AuthorEmailContains(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContains(FieldAuthorEmail, v)) +} + +// AuthorEmailHasPrefix applies the HasPrefix predicate on the "author_email" field. +func AuthorEmailHasPrefix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasPrefix(FieldAuthorEmail, v)) +} + +// AuthorEmailHasSuffix applies the HasSuffix predicate on the "author_email" field. +func AuthorEmailHasSuffix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasSuffix(FieldAuthorEmail, v)) +} + +// AuthorEmailEqualFold applies the EqualFold predicate on the "author_email" field. +func AuthorEmailEqualFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEqualFold(FieldAuthorEmail, v)) +} + +// AuthorEmailContainsFold applies the ContainsFold predicate on the "author_email" field. +func AuthorEmailContainsFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContainsFold(FieldAuthorEmail, v)) +} + +// CommitterNameEQ applies the EQ predicate on the "committer_name" field. +func CommitterNameEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitterName, v)) +} + +// CommitterNameNEQ applies the NEQ predicate on the "committer_name" field. +func CommitterNameNEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldCommitterName, v)) +} + +// CommitterNameIn applies the In predicate on the "committer_name" field. +func CommitterNameIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldCommitterName, vs...)) +} + +// CommitterNameNotIn applies the NotIn predicate on the "committer_name" field. +func CommitterNameNotIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldCommitterName, vs...)) +} + +// CommitterNameGT applies the GT predicate on the "committer_name" field. +func CommitterNameGT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldCommitterName, v)) +} + +// CommitterNameGTE applies the GTE predicate on the "committer_name" field. +func CommitterNameGTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldCommitterName, v)) +} + +// CommitterNameLT applies the LT predicate on the "committer_name" field. +func CommitterNameLT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldCommitterName, v)) +} + +// CommitterNameLTE applies the LTE predicate on the "committer_name" field. +func CommitterNameLTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldCommitterName, v)) +} + +// CommitterNameContains applies the Contains predicate on the "committer_name" field. +func CommitterNameContains(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContains(FieldCommitterName, v)) +} + +// CommitterNameHasPrefix applies the HasPrefix predicate on the "committer_name" field. +func CommitterNameHasPrefix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasPrefix(FieldCommitterName, v)) +} + +// CommitterNameHasSuffix applies the HasSuffix predicate on the "committer_name" field. +func CommitterNameHasSuffix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasSuffix(FieldCommitterName, v)) +} + +// CommitterNameEqualFold applies the EqualFold predicate on the "committer_name" field. +func CommitterNameEqualFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEqualFold(FieldCommitterName, v)) +} + +// CommitterNameContainsFold applies the ContainsFold predicate on the "committer_name" field. +func CommitterNameContainsFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContainsFold(FieldCommitterName, v)) +} + +// CommitterEmailEQ applies the EQ predicate on the "committer_email" field. +func CommitterEmailEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitterEmail, v)) +} + +// CommitterEmailNEQ applies the NEQ predicate on the "committer_email" field. +func CommitterEmailNEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldCommitterEmail, v)) +} + +// CommitterEmailIn applies the In predicate on the "committer_email" field. +func CommitterEmailIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldCommitterEmail, vs...)) +} + +// CommitterEmailNotIn applies the NotIn predicate on the "committer_email" field. +func CommitterEmailNotIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldCommitterEmail, vs...)) +} + +// CommitterEmailGT applies the GT predicate on the "committer_email" field. +func CommitterEmailGT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldCommitterEmail, v)) +} + +// CommitterEmailGTE applies the GTE predicate on the "committer_email" field. +func CommitterEmailGTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldCommitterEmail, v)) +} + +// CommitterEmailLT applies the LT predicate on the "committer_email" field. +func CommitterEmailLT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldCommitterEmail, v)) +} + +// CommitterEmailLTE applies the LTE predicate on the "committer_email" field. +func CommitterEmailLTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldCommitterEmail, v)) +} + +// CommitterEmailContains applies the Contains predicate on the "committer_email" field. +func CommitterEmailContains(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContains(FieldCommitterEmail, v)) +} + +// CommitterEmailHasPrefix applies the HasPrefix predicate on the "committer_email" field. +func CommitterEmailHasPrefix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasPrefix(FieldCommitterEmail, v)) +} + +// CommitterEmailHasSuffix applies the HasSuffix predicate on the "committer_email" field. +func CommitterEmailHasSuffix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasSuffix(FieldCommitterEmail, v)) +} + +// CommitterEmailEqualFold applies the EqualFold predicate on the "committer_email" field. +func CommitterEmailEqualFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEqualFold(FieldCommitterEmail, v)) +} + +// CommitterEmailContainsFold applies the ContainsFold predicate on the "committer_email" field. +func CommitterEmailContainsFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContainsFold(FieldCommitterEmail, v)) +} + +// CommitDateEQ applies the EQ predicate on the "commit_date" field. +func CommitDateEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitDate, v)) +} + +// CommitDateNEQ applies the NEQ predicate on the "commit_date" field. +func CommitDateNEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldCommitDate, v)) +} + +// CommitDateIn applies the In predicate on the "commit_date" field. +func CommitDateIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldCommitDate, vs...)) +} + +// CommitDateNotIn applies the NotIn predicate on the "commit_date" field. +func CommitDateNotIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldCommitDate, vs...)) +} + +// CommitDateGT applies the GT predicate on the "commit_date" field. +func CommitDateGT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldCommitDate, v)) +} + +// CommitDateGTE applies the GTE predicate on the "commit_date" field. +func CommitDateGTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldCommitDate, v)) +} + +// CommitDateLT applies the LT predicate on the "commit_date" field. +func CommitDateLT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldCommitDate, v)) +} + +// CommitDateLTE applies the LTE predicate on the "commit_date" field. +func CommitDateLTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldCommitDate, v)) +} + +// CommitDateContains applies the Contains predicate on the "commit_date" field. +func CommitDateContains(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContains(FieldCommitDate, v)) +} + +// CommitDateHasPrefix applies the HasPrefix predicate on the "commit_date" field. +func CommitDateHasPrefix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasPrefix(FieldCommitDate, v)) +} + +// CommitDateHasSuffix applies the HasSuffix predicate on the "commit_date" field. +func CommitDateHasSuffix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasSuffix(FieldCommitDate, v)) +} + +// CommitDateEqualFold applies the EqualFold predicate on the "commit_date" field. +func CommitDateEqualFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEqualFold(FieldCommitDate, v)) +} + +// CommitDateContainsFold applies the ContainsFold predicate on the "commit_date" field. +func CommitDateContainsFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContainsFold(FieldCommitDate, v)) +} + +// CommitMessageEQ applies the EQ predicate on the "commit_message" field. +func CommitMessageEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitMessage, v)) +} + +// CommitMessageNEQ applies the NEQ predicate on the "commit_message" field. +func CommitMessageNEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldCommitMessage, v)) +} + +// CommitMessageIn applies the In predicate on the "commit_message" field. +func CommitMessageIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldCommitMessage, vs...)) +} + +// CommitMessageNotIn applies the NotIn predicate on the "commit_message" field. +func CommitMessageNotIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldCommitMessage, vs...)) +} + +// CommitMessageGT applies the GT predicate on the "commit_message" field. +func CommitMessageGT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldCommitMessage, v)) +} + +// CommitMessageGTE applies the GTE predicate on the "commit_message" field. +func CommitMessageGTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldCommitMessage, v)) +} + +// CommitMessageLT applies the LT predicate on the "commit_message" field. +func CommitMessageLT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldCommitMessage, v)) +} + +// CommitMessageLTE applies the LTE predicate on the "commit_message" field. +func CommitMessageLTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldCommitMessage, v)) +} + +// CommitMessageContains applies the Contains predicate on the "commit_message" field. +func CommitMessageContains(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContains(FieldCommitMessage, v)) +} + +// CommitMessageHasPrefix applies the HasPrefix predicate on the "commit_message" field. +func CommitMessageHasPrefix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasPrefix(FieldCommitMessage, v)) +} + +// CommitMessageHasSuffix applies the HasSuffix predicate on the "commit_message" field. +func CommitMessageHasSuffix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasSuffix(FieldCommitMessage, v)) +} + +// CommitMessageEqualFold applies the EqualFold predicate on the "commit_message" field. +func CommitMessageEqualFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEqualFold(FieldCommitMessage, v)) +} + +// CommitMessageContainsFold applies the ContainsFold predicate on the "commit_message" field. +func CommitMessageContainsFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContainsFold(FieldCommitMessage, v)) +} + +// CommitTypeEQ applies the EQ predicate on the "commit_type" field. +func CommitTypeEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitType, v)) +} + +// CommitTypeNEQ applies the NEQ predicate on the "commit_type" field. +func CommitTypeNEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldCommitType, v)) +} + +// CommitTypeIn applies the In predicate on the "commit_type" field. +func CommitTypeIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldCommitType, vs...)) +} + +// CommitTypeNotIn applies the NotIn predicate on the "commit_type" field. +func CommitTypeNotIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldCommitType, vs...)) +} + +// CommitTypeGT applies the GT predicate on the "commit_type" field. +func CommitTypeGT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldCommitType, v)) +} + +// CommitTypeGTE applies the GTE predicate on the "commit_type" field. +func CommitTypeGTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldCommitType, v)) +} + +// CommitTypeLT applies the LT predicate on the "commit_type" field. +func CommitTypeLT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldCommitType, v)) +} + +// CommitTypeLTE applies the LTE predicate on the "commit_type" field. +func CommitTypeLTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldCommitType, v)) +} + +// CommitTypeContains applies the Contains predicate on the "commit_type" field. +func CommitTypeContains(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContains(FieldCommitType, v)) +} + +// CommitTypeHasPrefix applies the HasPrefix predicate on the "commit_type" field. +func CommitTypeHasPrefix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasPrefix(FieldCommitType, v)) +} + +// CommitTypeHasSuffix applies the HasSuffix predicate on the "commit_type" field. +func CommitTypeHasSuffix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasSuffix(FieldCommitType, v)) +} + +// CommitTypeEqualFold applies the EqualFold predicate on the "commit_type" field. +func CommitTypeEqualFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEqualFold(FieldCommitType, v)) +} + +// CommitTypeContainsFold applies the ContainsFold predicate on the "commit_type" field. +func CommitTypeContainsFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContainsFold(FieldCommitType, v)) +} + +// CommitDigestEQ applies the EQ predicate on the "commit_digest" field. +func CommitDigestEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldCommitDigest, v)) +} + +// CommitDigestNEQ applies the NEQ predicate on the "commit_digest" field. +func CommitDigestNEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldCommitDigest, v)) +} + +// CommitDigestIn applies the In predicate on the "commit_digest" field. +func CommitDigestIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldCommitDigest, vs...)) +} + +// CommitDigestNotIn applies the NotIn predicate on the "commit_digest" field. +func CommitDigestNotIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldCommitDigest, vs...)) +} + +// CommitDigestGT applies the GT predicate on the "commit_digest" field. +func CommitDigestGT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldCommitDigest, v)) +} + +// CommitDigestGTE applies the GTE predicate on the "commit_digest" field. +func CommitDigestGTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldCommitDigest, v)) +} + +// CommitDigestLT applies the LT predicate on the "commit_digest" field. +func CommitDigestLT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldCommitDigest, v)) +} + +// CommitDigestLTE applies the LTE predicate on the "commit_digest" field. +func CommitDigestLTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldCommitDigest, v)) +} + +// CommitDigestContains applies the Contains predicate on the "commit_digest" field. +func CommitDigestContains(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContains(FieldCommitDigest, v)) +} + +// CommitDigestHasPrefix applies the HasPrefix predicate on the "commit_digest" field. +func CommitDigestHasPrefix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasPrefix(FieldCommitDigest, v)) +} + +// CommitDigestHasSuffix applies the HasSuffix predicate on the "commit_digest" field. +func CommitDigestHasSuffix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasSuffix(FieldCommitDigest, v)) +} + +// CommitDigestEqualFold applies the EqualFold predicate on the "commit_digest" field. +func CommitDigestEqualFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEqualFold(FieldCommitDigest, v)) +} + +// CommitDigestContainsFold applies the ContainsFold predicate on the "commit_digest" field. +func CommitDigestContainsFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContainsFold(FieldCommitDigest, v)) +} + +// SignatureEQ applies the EQ predicate on the "signature" field. +func SignatureEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldSignature, v)) +} + +// SignatureNEQ applies the NEQ predicate on the "signature" field. +func SignatureNEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldSignature, v)) +} + +// SignatureIn applies the In predicate on the "signature" field. +func SignatureIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldSignature, vs...)) +} + +// SignatureNotIn applies the NotIn predicate on the "signature" field. +func SignatureNotIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldSignature, vs...)) +} + +// SignatureGT applies the GT predicate on the "signature" field. +func SignatureGT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldSignature, v)) +} + +// SignatureGTE applies the GTE predicate on the "signature" field. +func SignatureGTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldSignature, v)) +} + +// SignatureLT applies the LT predicate on the "signature" field. +func SignatureLT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldSignature, v)) +} + +// SignatureLTE applies the LTE predicate on the "signature" field. +func SignatureLTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldSignature, v)) +} + +// SignatureContains applies the Contains predicate on the "signature" field. +func SignatureContains(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContains(FieldSignature, v)) +} + +// SignatureHasPrefix applies the HasPrefix predicate on the "signature" field. +func SignatureHasPrefix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasPrefix(FieldSignature, v)) +} + +// SignatureHasSuffix applies the HasSuffix predicate on the "signature" field. +func SignatureHasSuffix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasSuffix(FieldSignature, v)) +} + +// SignatureEqualFold applies the EqualFold predicate on the "signature" field. +func SignatureEqualFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEqualFold(FieldSignature, v)) +} + +// SignatureContainsFold applies the ContainsFold predicate on the "signature" field. +func SignatureContainsFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContainsFold(FieldSignature, v)) +} + +// TreeHashEQ applies the EQ predicate on the "tree_hash" field. +func TreeHashEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEQ(FieldTreeHash, v)) +} + +// TreeHashNEQ applies the NEQ predicate on the "tree_hash" field. +func TreeHashNEQ(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNEQ(FieldTreeHash, v)) +} + +// TreeHashIn applies the In predicate on the "tree_hash" field. +func TreeHashIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldIn(FieldTreeHash, vs...)) +} + +// TreeHashNotIn applies the NotIn predicate on the "tree_hash" field. +func TreeHashNotIn(vs ...string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldNotIn(FieldTreeHash, vs...)) +} + +// TreeHashGT applies the GT predicate on the "tree_hash" field. +func TreeHashGT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGT(FieldTreeHash, v)) +} + +// TreeHashGTE applies the GTE predicate on the "tree_hash" field. +func TreeHashGTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldGTE(FieldTreeHash, v)) +} + +// TreeHashLT applies the LT predicate on the "tree_hash" field. +func TreeHashLT(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLT(FieldTreeHash, v)) +} + +// TreeHashLTE applies the LTE predicate on the "tree_hash" field. +func TreeHashLTE(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldLTE(FieldTreeHash, v)) +} + +// TreeHashContains applies the Contains predicate on the "tree_hash" field. +func TreeHashContains(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContains(FieldTreeHash, v)) +} + +// TreeHashHasPrefix applies the HasPrefix predicate on the "tree_hash" field. +func TreeHashHasPrefix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasPrefix(FieldTreeHash, v)) +} + +// TreeHashHasSuffix applies the HasSuffix predicate on the "tree_hash" field. +func TreeHashHasSuffix(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldHasSuffix(FieldTreeHash, v)) +} + +// TreeHashEqualFold applies the EqualFold predicate on the "tree_hash" field. +func TreeHashEqualFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldEqualFold(FieldTreeHash, v)) +} + +// TreeHashContainsFold applies the ContainsFold predicate on the "tree_hash" field. +func TreeHashContainsFold(v string) predicate.GitAttestation { + return predicate.GitAttestation(sql.FieldContainsFold(FieldTreeHash, v)) +} + +// HasAttestation applies the HasEdge predicate on the "attestation" edge. +func HasAttestation() predicate.GitAttestation { + return predicate.GitAttestation(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, AttestationTable, AttestationColumn), + ) + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasAttestationWith applies the HasEdge predicate on the "attestation" edge with a given conditions (other predicates). +func HasAttestationWith(preds ...predicate.Attestation) predicate.GitAttestation { + return predicate.GitAttestation(func(s *sql.Selector) { + step := newAttestationStep() + 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.GitAttestation) predicate.GitAttestation { + return predicate.GitAttestation(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.GitAttestation) predicate.GitAttestation { + return predicate.GitAttestation(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.GitAttestation) predicate.GitAttestation { + return predicate.GitAttestation(sql.NotPredicates(p)) +} diff --git a/ent/gitattestation_create.go b/ent/gitattestation_create.go new file mode 100644 index 00000000..cef7aa96 --- /dev/null +++ b/ent/gitattestation_create.go @@ -0,0 +1,427 @@ +// 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/google/uuid" + "github.com/in-toto/archivista/ent/attestation" + "github.com/in-toto/archivista/ent/gitattestation" +) + +// GitAttestationCreate is the builder for creating a GitAttestation entity. +type GitAttestationCreate struct { + config + mutation *GitAttestationMutation + hooks []Hook +} + +// SetCommitHash sets the "commit_hash" field. +func (gac *GitAttestationCreate) SetCommitHash(s string) *GitAttestationCreate { + gac.mutation.SetCommitHash(s) + return gac +} + +// SetAuthor sets the "author" field. +func (gac *GitAttestationCreate) SetAuthor(s string) *GitAttestationCreate { + gac.mutation.SetAuthor(s) + return gac +} + +// SetAuthorEmail sets the "author_email" field. +func (gac *GitAttestationCreate) SetAuthorEmail(s string) *GitAttestationCreate { + gac.mutation.SetAuthorEmail(s) + return gac +} + +// SetCommitterName sets the "committer_name" field. +func (gac *GitAttestationCreate) SetCommitterName(s string) *GitAttestationCreate { + gac.mutation.SetCommitterName(s) + return gac +} + +// SetCommitterEmail sets the "committer_email" field. +func (gac *GitAttestationCreate) SetCommitterEmail(s string) *GitAttestationCreate { + gac.mutation.SetCommitterEmail(s) + return gac +} + +// SetCommitDate sets the "commit_date" field. +func (gac *GitAttestationCreate) SetCommitDate(s string) *GitAttestationCreate { + gac.mutation.SetCommitDate(s) + return gac +} + +// SetCommitMessage sets the "commit_message" field. +func (gac *GitAttestationCreate) SetCommitMessage(s string) *GitAttestationCreate { + gac.mutation.SetCommitMessage(s) + return gac +} + +// SetStatus sets the "status" field. +func (gac *GitAttestationCreate) SetStatus(s []string) *GitAttestationCreate { + gac.mutation.SetStatus(s) + return gac +} + +// SetCommitType sets the "commit_type" field. +func (gac *GitAttestationCreate) SetCommitType(s string) *GitAttestationCreate { + gac.mutation.SetCommitType(s) + return gac +} + +// SetCommitDigest sets the "commit_digest" field. +func (gac *GitAttestationCreate) SetCommitDigest(s string) *GitAttestationCreate { + gac.mutation.SetCommitDigest(s) + return gac +} + +// SetSignature sets the "signature" field. +func (gac *GitAttestationCreate) SetSignature(s string) *GitAttestationCreate { + gac.mutation.SetSignature(s) + return gac +} + +// SetParentHashes sets the "parent_hashes" field. +func (gac *GitAttestationCreate) SetParentHashes(s []string) *GitAttestationCreate { + gac.mutation.SetParentHashes(s) + return gac +} + +// SetTreeHash sets the "tree_hash" field. +func (gac *GitAttestationCreate) SetTreeHash(s string) *GitAttestationCreate { + gac.mutation.SetTreeHash(s) + return gac +} + +// SetRefs sets the "refs" field. +func (gac *GitAttestationCreate) SetRefs(s []string) *GitAttestationCreate { + gac.mutation.SetRefs(s) + return gac +} + +// SetRemotes sets the "remotes" field. +func (gac *GitAttestationCreate) SetRemotes(s []string) *GitAttestationCreate { + gac.mutation.SetRemotes(s) + return gac +} + +// SetID sets the "id" field. +func (gac *GitAttestationCreate) SetID(u uuid.UUID) *GitAttestationCreate { + gac.mutation.SetID(u) + return gac +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (gac *GitAttestationCreate) SetNillableID(u *uuid.UUID) *GitAttestationCreate { + if u != nil { + gac.SetID(*u) + } + return gac +} + +// SetAttestationID sets the "attestation" edge to the Attestation entity by ID. +func (gac *GitAttestationCreate) SetAttestationID(id uuid.UUID) *GitAttestationCreate { + gac.mutation.SetAttestationID(id) + return gac +} + +// SetAttestation sets the "attestation" edge to the Attestation entity. +func (gac *GitAttestationCreate) SetAttestation(a *Attestation) *GitAttestationCreate { + return gac.SetAttestationID(a.ID) +} + +// Mutation returns the GitAttestationMutation object of the builder. +func (gac *GitAttestationCreate) Mutation() *GitAttestationMutation { + return gac.mutation +} + +// Save creates the GitAttestation in the database. +func (gac *GitAttestationCreate) Save(ctx context.Context) (*GitAttestation, error) { + gac.defaults() + return withHooks(ctx, gac.sqlSave, gac.mutation, gac.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (gac *GitAttestationCreate) SaveX(ctx context.Context) *GitAttestation { + v, err := gac.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gac *GitAttestationCreate) Exec(ctx context.Context) error { + _, err := gac.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gac *GitAttestationCreate) ExecX(ctx context.Context) { + if err := gac.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gac *GitAttestationCreate) defaults() { + if _, ok := gac.mutation.ID(); !ok { + v := gitattestation.DefaultID() + gac.mutation.SetID(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (gac *GitAttestationCreate) check() error { + if _, ok := gac.mutation.CommitHash(); !ok { + return &ValidationError{Name: "commit_hash", err: errors.New(`ent: missing required field "GitAttestation.commit_hash"`)} + } + if _, ok := gac.mutation.Author(); !ok { + return &ValidationError{Name: "author", err: errors.New(`ent: missing required field "GitAttestation.author"`)} + } + if _, ok := gac.mutation.AuthorEmail(); !ok { + return &ValidationError{Name: "author_email", err: errors.New(`ent: missing required field "GitAttestation.author_email"`)} + } + if _, ok := gac.mutation.CommitterName(); !ok { + return &ValidationError{Name: "committer_name", err: errors.New(`ent: missing required field "GitAttestation.committer_name"`)} + } + if _, ok := gac.mutation.CommitterEmail(); !ok { + return &ValidationError{Name: "committer_email", err: errors.New(`ent: missing required field "GitAttestation.committer_email"`)} + } + if _, ok := gac.mutation.CommitDate(); !ok { + return &ValidationError{Name: "commit_date", err: errors.New(`ent: missing required field "GitAttestation.commit_date"`)} + } + if _, ok := gac.mutation.CommitMessage(); !ok { + return &ValidationError{Name: "commit_message", err: errors.New(`ent: missing required field "GitAttestation.commit_message"`)} + } + if _, ok := gac.mutation.Status(); !ok { + return &ValidationError{Name: "status", err: errors.New(`ent: missing required field "GitAttestation.status"`)} + } + if _, ok := gac.mutation.CommitType(); !ok { + return &ValidationError{Name: "commit_type", err: errors.New(`ent: missing required field "GitAttestation.commit_type"`)} + } + if _, ok := gac.mutation.CommitDigest(); !ok { + return &ValidationError{Name: "commit_digest", err: errors.New(`ent: missing required field "GitAttestation.commit_digest"`)} + } + if _, ok := gac.mutation.Signature(); !ok { + return &ValidationError{Name: "signature", err: errors.New(`ent: missing required field "GitAttestation.signature"`)} + } + if _, ok := gac.mutation.ParentHashes(); !ok { + return &ValidationError{Name: "parent_hashes", err: errors.New(`ent: missing required field "GitAttestation.parent_hashes"`)} + } + if _, ok := gac.mutation.TreeHash(); !ok { + return &ValidationError{Name: "tree_hash", err: errors.New(`ent: missing required field "GitAttestation.tree_hash"`)} + } + if _, ok := gac.mutation.Refs(); !ok { + return &ValidationError{Name: "refs", err: errors.New(`ent: missing required field "GitAttestation.refs"`)} + } + if _, ok := gac.mutation.Remotes(); !ok { + return &ValidationError{Name: "remotes", err: errors.New(`ent: missing required field "GitAttestation.remotes"`)} + } + if _, ok := gac.mutation.AttestationID(); !ok { + return &ValidationError{Name: "attestation", err: errors.New(`ent: missing required edge "GitAttestation.attestation"`)} + } + return nil +} + +func (gac *GitAttestationCreate) sqlSave(ctx context.Context) (*GitAttestation, error) { + if err := gac.check(); err != nil { + return nil, err + } + _node, _spec := gac.createSpec() + if err := sqlgraph.CreateNode(ctx, gac.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + if _spec.ID.Value != nil { + if id, ok := _spec.ID.Value.(*uuid.UUID); ok { + _node.ID = *id + } else if err := _node.ID.Scan(_spec.ID.Value); err != nil { + return nil, err + } + } + gac.mutation.id = &_node.ID + gac.mutation.done = true + return _node, nil +} + +func (gac *GitAttestationCreate) createSpec() (*GitAttestation, *sqlgraph.CreateSpec) { + var ( + _node = &GitAttestation{config: gac.config} + _spec = sqlgraph.NewCreateSpec(gitattestation.Table, sqlgraph.NewFieldSpec(gitattestation.FieldID, field.TypeUUID)) + ) + if id, ok := gac.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = &id + } + if value, ok := gac.mutation.CommitHash(); ok { + _spec.SetField(gitattestation.FieldCommitHash, field.TypeString, value) + _node.CommitHash = value + } + if value, ok := gac.mutation.Author(); ok { + _spec.SetField(gitattestation.FieldAuthor, field.TypeString, value) + _node.Author = value + } + if value, ok := gac.mutation.AuthorEmail(); ok { + _spec.SetField(gitattestation.FieldAuthorEmail, field.TypeString, value) + _node.AuthorEmail = value + } + if value, ok := gac.mutation.CommitterName(); ok { + _spec.SetField(gitattestation.FieldCommitterName, field.TypeString, value) + _node.CommitterName = value + } + if value, ok := gac.mutation.CommitterEmail(); ok { + _spec.SetField(gitattestation.FieldCommitterEmail, field.TypeString, value) + _node.CommitterEmail = value + } + if value, ok := gac.mutation.CommitDate(); ok { + _spec.SetField(gitattestation.FieldCommitDate, field.TypeString, value) + _node.CommitDate = value + } + if value, ok := gac.mutation.CommitMessage(); ok { + _spec.SetField(gitattestation.FieldCommitMessage, field.TypeString, value) + _node.CommitMessage = value + } + if value, ok := gac.mutation.Status(); ok { + _spec.SetField(gitattestation.FieldStatus, field.TypeJSON, value) + _node.Status = value + } + if value, ok := gac.mutation.CommitType(); ok { + _spec.SetField(gitattestation.FieldCommitType, field.TypeString, value) + _node.CommitType = value + } + if value, ok := gac.mutation.CommitDigest(); ok { + _spec.SetField(gitattestation.FieldCommitDigest, field.TypeString, value) + _node.CommitDigest = value + } + if value, ok := gac.mutation.Signature(); ok { + _spec.SetField(gitattestation.FieldSignature, field.TypeString, value) + _node.Signature = value + } + if value, ok := gac.mutation.ParentHashes(); ok { + _spec.SetField(gitattestation.FieldParentHashes, field.TypeJSON, value) + _node.ParentHashes = value + } + if value, ok := gac.mutation.TreeHash(); ok { + _spec.SetField(gitattestation.FieldTreeHash, field.TypeString, value) + _node.TreeHash = value + } + if value, ok := gac.mutation.Refs(); ok { + _spec.SetField(gitattestation.FieldRefs, field.TypeJSON, value) + _node.Refs = value + } + if value, ok := gac.mutation.Remotes(); ok { + _spec.SetField(gitattestation.FieldRemotes, field.TypeJSON, value) + _node.Remotes = value + } + if nodes := gac.mutation.AttestationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: gitattestation.AttestationTable, + Columns: []string{gitattestation.AttestationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(attestation.FieldID, field.TypeUUID), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.attestation_git_attestation = &nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// GitAttestationCreateBulk is the builder for creating many GitAttestation entities in bulk. +type GitAttestationCreateBulk struct { + config + err error + builders []*GitAttestationCreate +} + +// Save creates the GitAttestation entities in the database. +func (gacb *GitAttestationCreateBulk) Save(ctx context.Context) ([]*GitAttestation, error) { + if gacb.err != nil { + return nil, gacb.err + } + specs := make([]*sqlgraph.CreateSpec, len(gacb.builders)) + nodes := make([]*GitAttestation, len(gacb.builders)) + mutators := make([]Mutator, len(gacb.builders)) + for i := range gacb.builders { + func(i int, root context.Context) { + builder := gacb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*GitAttestationMutation) + 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, gacb.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, gacb.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + mutation.done = true + return nodes[i], nil + }) + for i := len(builder.hooks) - 1; i >= 0; i-- { + mut = builder.hooks[i](mut) + } + mutators[i] = mut + }(i, ctx) + } + if len(mutators) > 0 { + if _, err := mutators[0].Mutate(ctx, gacb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (gacb *GitAttestationCreateBulk) SaveX(ctx context.Context) []*GitAttestation { + v, err := gacb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gacb *GitAttestationCreateBulk) Exec(ctx context.Context) error { + _, err := gacb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gacb *GitAttestationCreateBulk) ExecX(ctx context.Context) { + if err := gacb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/ent/gitattestation_delete.go b/ent/gitattestation_delete.go new file mode 100644 index 00000000..3fc5a399 --- /dev/null +++ b/ent/gitattestation_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/gitattestation" + "github.com/in-toto/archivista/ent/predicate" +) + +// GitAttestationDelete is the builder for deleting a GitAttestation entity. +type GitAttestationDelete struct { + config + hooks []Hook + mutation *GitAttestationMutation +} + +// Where appends a list predicates to the GitAttestationDelete builder. +func (gad *GitAttestationDelete) Where(ps ...predicate.GitAttestation) *GitAttestationDelete { + gad.mutation.Where(ps...) + return gad +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (gad *GitAttestationDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, gad.sqlExec, gad.mutation, gad.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (gad *GitAttestationDelete) ExecX(ctx context.Context) int { + n, err := gad.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (gad *GitAttestationDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(gitattestation.Table, sqlgraph.NewFieldSpec(gitattestation.FieldID, field.TypeUUID)) + if ps := gad.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, gad.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + gad.mutation.done = true + return affected, err +} + +// GitAttestationDeleteOne is the builder for deleting a single GitAttestation entity. +type GitAttestationDeleteOne struct { + gad *GitAttestationDelete +} + +// Where appends a list predicates to the GitAttestationDelete builder. +func (gado *GitAttestationDeleteOne) Where(ps ...predicate.GitAttestation) *GitAttestationDeleteOne { + gado.gad.mutation.Where(ps...) + return gado +} + +// Exec executes the deletion query. +func (gado *GitAttestationDeleteOne) Exec(ctx context.Context) error { + n, err := gado.gad.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{gitattestation.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (gado *GitAttestationDeleteOne) ExecX(ctx context.Context) { + if err := gado.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/ent/gitattestation_query.go b/ent/gitattestation_query.go new file mode 100644 index 00000000..3e864fe8 --- /dev/null +++ b/ent/gitattestation_query.go @@ -0,0 +1,627 @@ +// 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/google/uuid" + "github.com/in-toto/archivista/ent/attestation" + "github.com/in-toto/archivista/ent/gitattestation" + "github.com/in-toto/archivista/ent/predicate" +) + +// GitAttestationQuery is the builder for querying GitAttestation entities. +type GitAttestationQuery struct { + config + ctx *QueryContext + order []gitattestation.OrderOption + inters []Interceptor + predicates []predicate.GitAttestation + withAttestation *AttestationQuery + withFKs bool + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*GitAttestation) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the GitAttestationQuery builder. +func (gaq *GitAttestationQuery) Where(ps ...predicate.GitAttestation) *GitAttestationQuery { + gaq.predicates = append(gaq.predicates, ps...) + return gaq +} + +// Limit the number of records to be returned by this query. +func (gaq *GitAttestationQuery) Limit(limit int) *GitAttestationQuery { + gaq.ctx.Limit = &limit + return gaq +} + +// Offset to start from. +func (gaq *GitAttestationQuery) Offset(offset int) *GitAttestationQuery { + gaq.ctx.Offset = &offset + return gaq +} + +// 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 (gaq *GitAttestationQuery) Unique(unique bool) *GitAttestationQuery { + gaq.ctx.Unique = &unique + return gaq +} + +// Order specifies how the records should be ordered. +func (gaq *GitAttestationQuery) Order(o ...gitattestation.OrderOption) *GitAttestationQuery { + gaq.order = append(gaq.order, o...) + return gaq +} + +// QueryAttestation chains the current query on the "attestation" edge. +func (gaq *GitAttestationQuery) QueryAttestation() *AttestationQuery { + query := (&AttestationClient{config: gaq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gaq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gaq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(gitattestation.Table, gitattestation.FieldID, selector), + sqlgraph.To(attestation.Table, attestation.FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, gitattestation.AttestationTable, gitattestation.AttestationColumn), + ) + fromU = sqlgraph.SetNeighbors(gaq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first GitAttestation entity from the query. +// Returns a *NotFoundError when no GitAttestation was found. +func (gaq *GitAttestationQuery) First(ctx context.Context) (*GitAttestation, error) { + nodes, err := gaq.Limit(1).All(setContextOp(ctx, gaq.ctx, "First")) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{gitattestation.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (gaq *GitAttestationQuery) FirstX(ctx context.Context) *GitAttestation { + node, err := gaq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first GitAttestation ID from the query. +// Returns a *NotFoundError when no GitAttestation ID was found. +func (gaq *GitAttestationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error) { + var ids []uuid.UUID + if ids, err = gaq.Limit(1).IDs(setContextOp(ctx, gaq.ctx, "FirstID")); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{gitattestation.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (gaq *GitAttestationQuery) FirstIDX(ctx context.Context) uuid.UUID { + id, err := gaq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single GitAttestation entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one GitAttestation entity is found. +// Returns a *NotFoundError when no GitAttestation entities are found. +func (gaq *GitAttestationQuery) Only(ctx context.Context) (*GitAttestation, error) { + nodes, err := gaq.Limit(2).All(setContextOp(ctx, gaq.ctx, "Only")) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{gitattestation.Label} + default: + return nil, &NotSingularError{gitattestation.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (gaq *GitAttestationQuery) OnlyX(ctx context.Context) *GitAttestation { + node, err := gaq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only GitAttestation ID in the query. +// Returns a *NotSingularError when more than one GitAttestation ID is found. +// Returns a *NotFoundError when no entities are found. +func (gaq *GitAttestationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error) { + var ids []uuid.UUID + if ids, err = gaq.Limit(2).IDs(setContextOp(ctx, gaq.ctx, "OnlyID")); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{gitattestation.Label} + default: + err = &NotSingularError{gitattestation.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (gaq *GitAttestationQuery) OnlyIDX(ctx context.Context) uuid.UUID { + id, err := gaq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of GitAttestations. +func (gaq *GitAttestationQuery) All(ctx context.Context) ([]*GitAttestation, error) { + ctx = setContextOp(ctx, gaq.ctx, "All") + if err := gaq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*GitAttestation, *GitAttestationQuery]() + return withInterceptors[[]*GitAttestation](ctx, gaq, qr, gaq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (gaq *GitAttestationQuery) AllX(ctx context.Context) []*GitAttestation { + nodes, err := gaq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of GitAttestation IDs. +func (gaq *GitAttestationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error) { + if gaq.ctx.Unique == nil && gaq.path != nil { + gaq.Unique(true) + } + ctx = setContextOp(ctx, gaq.ctx, "IDs") + if err = gaq.Select(gitattestation.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (gaq *GitAttestationQuery) IDsX(ctx context.Context) []uuid.UUID { + ids, err := gaq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (gaq *GitAttestationQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, gaq.ctx, "Count") + if err := gaq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, gaq, querierCount[*GitAttestationQuery](), gaq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (gaq *GitAttestationQuery) CountX(ctx context.Context) int { + count, err := gaq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (gaq *GitAttestationQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, gaq.ctx, "Exist") + switch _, err := gaq.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 (gaq *GitAttestationQuery) ExistX(ctx context.Context) bool { + exist, err := gaq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the GitAttestationQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (gaq *GitAttestationQuery) Clone() *GitAttestationQuery { + if gaq == nil { + return nil + } + return &GitAttestationQuery{ + config: gaq.config, + ctx: gaq.ctx.Clone(), + order: append([]gitattestation.OrderOption{}, gaq.order...), + inters: append([]Interceptor{}, gaq.inters...), + predicates: append([]predicate.GitAttestation{}, gaq.predicates...), + withAttestation: gaq.withAttestation.Clone(), + // clone intermediate query. + sql: gaq.sql.Clone(), + path: gaq.path, + } +} + +// WithAttestation tells the query-builder to eager-load the nodes that are connected to +// the "attestation" edge. The optional arguments are used to configure the query builder of the edge. +func (gaq *GitAttestationQuery) WithAttestation(opts ...func(*AttestationQuery)) *GitAttestationQuery { + query := (&AttestationClient{config: gaq.config}).Query() + for _, opt := range opts { + opt(query) + } + gaq.withAttestation = query + return gaq +} + +// 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 { +// CommitHash string `json:"commit_hash,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.GitAttestation.Query(). +// GroupBy(gitattestation.FieldCommitHash). +// Aggregate(ent.Count()). +// Scan(ctx, &v) +func (gaq *GitAttestationQuery) GroupBy(field string, fields ...string) *GitAttestationGroupBy { + gaq.ctx.Fields = append([]string{field}, fields...) + grbuild := &GitAttestationGroupBy{build: gaq} + grbuild.flds = &gaq.ctx.Fields + grbuild.label = gitattestation.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 { +// CommitHash string `json:"commit_hash,omitempty"` +// } +// +// client.GitAttestation.Query(). +// Select(gitattestation.FieldCommitHash). +// Scan(ctx, &v) +func (gaq *GitAttestationQuery) Select(fields ...string) *GitAttestationSelect { + gaq.ctx.Fields = append(gaq.ctx.Fields, fields...) + sbuild := &GitAttestationSelect{GitAttestationQuery: gaq} + sbuild.label = gitattestation.Label + sbuild.flds, sbuild.scan = &gaq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a GitAttestationSelect configured with the given aggregations. +func (gaq *GitAttestationQuery) Aggregate(fns ...AggregateFunc) *GitAttestationSelect { + return gaq.Select().Aggregate(fns...) +} + +func (gaq *GitAttestationQuery) prepareQuery(ctx context.Context) error { + for _, inter := range gaq.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, gaq); err != nil { + return err + } + } + } + for _, f := range gaq.ctx.Fields { + if !gitattestation.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + } + if gaq.path != nil { + prev, err := gaq.path(ctx) + if err != nil { + return err + } + gaq.sql = prev + } + return nil +} + +func (gaq *GitAttestationQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*GitAttestation, error) { + var ( + nodes = []*GitAttestation{} + withFKs = gaq.withFKs + _spec = gaq.querySpec() + loadedTypes = [1]bool{ + gaq.withAttestation != nil, + } + ) + if gaq.withAttestation != nil { + withFKs = true + } + if withFKs { + _spec.Node.Columns = append(_spec.Node.Columns, gitattestation.ForeignKeys...) + } + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*GitAttestation).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &GitAttestation{config: gaq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + if len(gaq.modifiers) > 0 { + _spec.Modifiers = gaq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, gaq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := gaq.withAttestation; query != nil { + if err := gaq.loadAttestation(ctx, query, nodes, nil, + func(n *GitAttestation, e *Attestation) { n.Edges.Attestation = e }); err != nil { + return nil, err + } + } + for i := range gaq.loadTotal { + if err := gaq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (gaq *GitAttestationQuery) loadAttestation(ctx context.Context, query *AttestationQuery, nodes []*GitAttestation, init func(*GitAttestation), assign func(*GitAttestation, *Attestation)) error { + ids := make([]uuid.UUID, 0, len(nodes)) + nodeids := make(map[uuid.UUID][]*GitAttestation) + for i := range nodes { + if nodes[i].attestation_git_attestation == nil { + continue + } + fk := *nodes[i].attestation_git_attestation + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(attestation.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 "attestation_git_attestation" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (gaq *GitAttestationQuery) sqlCount(ctx context.Context) (int, error) { + _spec := gaq.querySpec() + if len(gaq.modifiers) > 0 { + _spec.Modifiers = gaq.modifiers + } + _spec.Node.Columns = gaq.ctx.Fields + if len(gaq.ctx.Fields) > 0 { + _spec.Unique = gaq.ctx.Unique != nil && *gaq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, gaq.driver, _spec) +} + +func (gaq *GitAttestationQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(gitattestation.Table, gitattestation.Columns, sqlgraph.NewFieldSpec(gitattestation.FieldID, field.TypeUUID)) + _spec.From = gaq.sql + if unique := gaq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if gaq.path != nil { + _spec.Unique = true + } + if fields := gaq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, gitattestation.FieldID) + for i := range fields { + if fields[i] != gitattestation.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := gaq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := gaq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := gaq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := gaq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (gaq *GitAttestationQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(gaq.driver.Dialect()) + t1 := builder.Table(gitattestation.Table) + columns := gaq.ctx.Fields + if len(columns) == 0 { + columns = gitattestation.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if gaq.sql != nil { + selector = gaq.sql + selector.Select(selector.Columns(columns...)...) + } + if gaq.ctx.Unique != nil && *gaq.ctx.Unique { + selector.Distinct() + } + for _, p := range gaq.predicates { + p(selector) + } + for _, p := range gaq.order { + p(selector) + } + if offset := gaq.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 := gaq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// GitAttestationGroupBy is the group-by builder for GitAttestation entities. +type GitAttestationGroupBy struct { + selector + build *GitAttestationQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (gagb *GitAttestationGroupBy) Aggregate(fns ...AggregateFunc) *GitAttestationGroupBy { + gagb.fns = append(gagb.fns, fns...) + return gagb +} + +// Scan applies the selector query and scans the result into the given value. +func (gagb *GitAttestationGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, gagb.build.ctx, "GroupBy") + if err := gagb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GitAttestationQuery, *GitAttestationGroupBy](ctx, gagb.build, gagb, gagb.build.inters, v) +} + +func (gagb *GitAttestationGroupBy) sqlScan(ctx context.Context, root *GitAttestationQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(gagb.fns)) + for _, fn := range gagb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*gagb.flds)+len(gagb.fns)) + for _, f := range *gagb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*gagb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := gagb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// GitAttestationSelect is the builder for selecting fields of GitAttestation entities. +type GitAttestationSelect struct { + *GitAttestationQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (gas *GitAttestationSelect) Aggregate(fns ...AggregateFunc) *GitAttestationSelect { + gas.fns = append(gas.fns, fns...) + return gas +} + +// Scan applies the selector query and scans the result into the given value. +func (gas *GitAttestationSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, gas.ctx, "Select") + if err := gas.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GitAttestationQuery, *GitAttestationSelect](ctx, gas.GitAttestationQuery, gas, gas.inters, v) +} + +func (gas *GitAttestationSelect) sqlScan(ctx context.Context, root *GitAttestationQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(gas.fns)) + for _, fn := range gas.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*gas.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 := gas.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/ent/gitattestation_update.go b/ent/gitattestation_update.go new file mode 100644 index 00000000..7dcfd0de --- /dev/null +++ b/ent/gitattestation_update.go @@ -0,0 +1,826 @@ +// 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/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/google/uuid" + "github.com/in-toto/archivista/ent/attestation" + "github.com/in-toto/archivista/ent/gitattestation" + "github.com/in-toto/archivista/ent/predicate" +) + +// GitAttestationUpdate is the builder for updating GitAttestation entities. +type GitAttestationUpdate struct { + config + hooks []Hook + mutation *GitAttestationMutation +} + +// Where appends a list predicates to the GitAttestationUpdate builder. +func (gau *GitAttestationUpdate) Where(ps ...predicate.GitAttestation) *GitAttestationUpdate { + gau.mutation.Where(ps...) + return gau +} + +// SetCommitHash sets the "commit_hash" field. +func (gau *GitAttestationUpdate) SetCommitHash(s string) *GitAttestationUpdate { + gau.mutation.SetCommitHash(s) + return gau +} + +// SetNillableCommitHash sets the "commit_hash" field if the given value is not nil. +func (gau *GitAttestationUpdate) SetNillableCommitHash(s *string) *GitAttestationUpdate { + if s != nil { + gau.SetCommitHash(*s) + } + return gau +} + +// SetAuthor sets the "author" field. +func (gau *GitAttestationUpdate) SetAuthor(s string) *GitAttestationUpdate { + gau.mutation.SetAuthor(s) + return gau +} + +// SetNillableAuthor sets the "author" field if the given value is not nil. +func (gau *GitAttestationUpdate) SetNillableAuthor(s *string) *GitAttestationUpdate { + if s != nil { + gau.SetAuthor(*s) + } + return gau +} + +// SetAuthorEmail sets the "author_email" field. +func (gau *GitAttestationUpdate) SetAuthorEmail(s string) *GitAttestationUpdate { + gau.mutation.SetAuthorEmail(s) + return gau +} + +// SetNillableAuthorEmail sets the "author_email" field if the given value is not nil. +func (gau *GitAttestationUpdate) SetNillableAuthorEmail(s *string) *GitAttestationUpdate { + if s != nil { + gau.SetAuthorEmail(*s) + } + return gau +} + +// SetCommitterName sets the "committer_name" field. +func (gau *GitAttestationUpdate) SetCommitterName(s string) *GitAttestationUpdate { + gau.mutation.SetCommitterName(s) + return gau +} + +// SetNillableCommitterName sets the "committer_name" field if the given value is not nil. +func (gau *GitAttestationUpdate) SetNillableCommitterName(s *string) *GitAttestationUpdate { + if s != nil { + gau.SetCommitterName(*s) + } + return gau +} + +// SetCommitterEmail sets the "committer_email" field. +func (gau *GitAttestationUpdate) SetCommitterEmail(s string) *GitAttestationUpdate { + gau.mutation.SetCommitterEmail(s) + return gau +} + +// SetNillableCommitterEmail sets the "committer_email" field if the given value is not nil. +func (gau *GitAttestationUpdate) SetNillableCommitterEmail(s *string) *GitAttestationUpdate { + if s != nil { + gau.SetCommitterEmail(*s) + } + return gau +} + +// SetCommitDate sets the "commit_date" field. +func (gau *GitAttestationUpdate) SetCommitDate(s string) *GitAttestationUpdate { + gau.mutation.SetCommitDate(s) + return gau +} + +// SetNillableCommitDate sets the "commit_date" field if the given value is not nil. +func (gau *GitAttestationUpdate) SetNillableCommitDate(s *string) *GitAttestationUpdate { + if s != nil { + gau.SetCommitDate(*s) + } + return gau +} + +// SetCommitMessage sets the "commit_message" field. +func (gau *GitAttestationUpdate) SetCommitMessage(s string) *GitAttestationUpdate { + gau.mutation.SetCommitMessage(s) + return gau +} + +// SetNillableCommitMessage sets the "commit_message" field if the given value is not nil. +func (gau *GitAttestationUpdate) SetNillableCommitMessage(s *string) *GitAttestationUpdate { + if s != nil { + gau.SetCommitMessage(*s) + } + return gau +} + +// SetStatus sets the "status" field. +func (gau *GitAttestationUpdate) SetStatus(s []string) *GitAttestationUpdate { + gau.mutation.SetStatus(s) + return gau +} + +// AppendStatus appends s to the "status" field. +func (gau *GitAttestationUpdate) AppendStatus(s []string) *GitAttestationUpdate { + gau.mutation.AppendStatus(s) + return gau +} + +// SetCommitType sets the "commit_type" field. +func (gau *GitAttestationUpdate) SetCommitType(s string) *GitAttestationUpdate { + gau.mutation.SetCommitType(s) + return gau +} + +// SetNillableCommitType sets the "commit_type" field if the given value is not nil. +func (gau *GitAttestationUpdate) SetNillableCommitType(s *string) *GitAttestationUpdate { + if s != nil { + gau.SetCommitType(*s) + } + return gau +} + +// SetCommitDigest sets the "commit_digest" field. +func (gau *GitAttestationUpdate) SetCommitDigest(s string) *GitAttestationUpdate { + gau.mutation.SetCommitDigest(s) + return gau +} + +// SetNillableCommitDigest sets the "commit_digest" field if the given value is not nil. +func (gau *GitAttestationUpdate) SetNillableCommitDigest(s *string) *GitAttestationUpdate { + if s != nil { + gau.SetCommitDigest(*s) + } + return gau +} + +// SetSignature sets the "signature" field. +func (gau *GitAttestationUpdate) SetSignature(s string) *GitAttestationUpdate { + gau.mutation.SetSignature(s) + return gau +} + +// SetNillableSignature sets the "signature" field if the given value is not nil. +func (gau *GitAttestationUpdate) SetNillableSignature(s *string) *GitAttestationUpdate { + if s != nil { + gau.SetSignature(*s) + } + return gau +} + +// SetParentHashes sets the "parent_hashes" field. +func (gau *GitAttestationUpdate) SetParentHashes(s []string) *GitAttestationUpdate { + gau.mutation.SetParentHashes(s) + return gau +} + +// AppendParentHashes appends s to the "parent_hashes" field. +func (gau *GitAttestationUpdate) AppendParentHashes(s []string) *GitAttestationUpdate { + gau.mutation.AppendParentHashes(s) + return gau +} + +// SetTreeHash sets the "tree_hash" field. +func (gau *GitAttestationUpdate) SetTreeHash(s string) *GitAttestationUpdate { + gau.mutation.SetTreeHash(s) + return gau +} + +// SetNillableTreeHash sets the "tree_hash" field if the given value is not nil. +func (gau *GitAttestationUpdate) SetNillableTreeHash(s *string) *GitAttestationUpdate { + if s != nil { + gau.SetTreeHash(*s) + } + return gau +} + +// SetRefs sets the "refs" field. +func (gau *GitAttestationUpdate) SetRefs(s []string) *GitAttestationUpdate { + gau.mutation.SetRefs(s) + return gau +} + +// AppendRefs appends s to the "refs" field. +func (gau *GitAttestationUpdate) AppendRefs(s []string) *GitAttestationUpdate { + gau.mutation.AppendRefs(s) + return gau +} + +// SetRemotes sets the "remotes" field. +func (gau *GitAttestationUpdate) SetRemotes(s []string) *GitAttestationUpdate { + gau.mutation.SetRemotes(s) + return gau +} + +// AppendRemotes appends s to the "remotes" field. +func (gau *GitAttestationUpdate) AppendRemotes(s []string) *GitAttestationUpdate { + gau.mutation.AppendRemotes(s) + return gau +} + +// SetAttestationID sets the "attestation" edge to the Attestation entity by ID. +func (gau *GitAttestationUpdate) SetAttestationID(id uuid.UUID) *GitAttestationUpdate { + gau.mutation.SetAttestationID(id) + return gau +} + +// SetAttestation sets the "attestation" edge to the Attestation entity. +func (gau *GitAttestationUpdate) SetAttestation(a *Attestation) *GitAttestationUpdate { + return gau.SetAttestationID(a.ID) +} + +// Mutation returns the GitAttestationMutation object of the builder. +func (gau *GitAttestationUpdate) Mutation() *GitAttestationMutation { + return gau.mutation +} + +// ClearAttestation clears the "attestation" edge to the Attestation entity. +func (gau *GitAttestationUpdate) ClearAttestation() *GitAttestationUpdate { + gau.mutation.ClearAttestation() + return gau +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (gau *GitAttestationUpdate) Save(ctx context.Context) (int, error) { + return withHooks(ctx, gau.sqlSave, gau.mutation, gau.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (gau *GitAttestationUpdate) SaveX(ctx context.Context) int { + affected, err := gau.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (gau *GitAttestationUpdate) Exec(ctx context.Context) error { + _, err := gau.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gau *GitAttestationUpdate) ExecX(ctx context.Context) { + if err := gau.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (gau *GitAttestationUpdate) check() error { + if _, ok := gau.mutation.AttestationID(); gau.mutation.AttestationCleared() && !ok { + return errors.New(`ent: clearing a required unique edge "GitAttestation.attestation"`) + } + return nil +} + +func (gau *GitAttestationUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := gau.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(gitattestation.Table, gitattestation.Columns, sqlgraph.NewFieldSpec(gitattestation.FieldID, field.TypeUUID)) + if ps := gau.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := gau.mutation.CommitHash(); ok { + _spec.SetField(gitattestation.FieldCommitHash, field.TypeString, value) + } + if value, ok := gau.mutation.Author(); ok { + _spec.SetField(gitattestation.FieldAuthor, field.TypeString, value) + } + if value, ok := gau.mutation.AuthorEmail(); ok { + _spec.SetField(gitattestation.FieldAuthorEmail, field.TypeString, value) + } + if value, ok := gau.mutation.CommitterName(); ok { + _spec.SetField(gitattestation.FieldCommitterName, field.TypeString, value) + } + if value, ok := gau.mutation.CommitterEmail(); ok { + _spec.SetField(gitattestation.FieldCommitterEmail, field.TypeString, value) + } + if value, ok := gau.mutation.CommitDate(); ok { + _spec.SetField(gitattestation.FieldCommitDate, field.TypeString, value) + } + if value, ok := gau.mutation.CommitMessage(); ok { + _spec.SetField(gitattestation.FieldCommitMessage, field.TypeString, value) + } + if value, ok := gau.mutation.Status(); ok { + _spec.SetField(gitattestation.FieldStatus, field.TypeJSON, value) + } + if value, ok := gau.mutation.AppendedStatus(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, gitattestation.FieldStatus, value) + }) + } + if value, ok := gau.mutation.CommitType(); ok { + _spec.SetField(gitattestation.FieldCommitType, field.TypeString, value) + } + if value, ok := gau.mutation.CommitDigest(); ok { + _spec.SetField(gitattestation.FieldCommitDigest, field.TypeString, value) + } + if value, ok := gau.mutation.Signature(); ok { + _spec.SetField(gitattestation.FieldSignature, field.TypeString, value) + } + if value, ok := gau.mutation.ParentHashes(); ok { + _spec.SetField(gitattestation.FieldParentHashes, field.TypeJSON, value) + } + if value, ok := gau.mutation.AppendedParentHashes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, gitattestation.FieldParentHashes, value) + }) + } + if value, ok := gau.mutation.TreeHash(); ok { + _spec.SetField(gitattestation.FieldTreeHash, field.TypeString, value) + } + if value, ok := gau.mutation.Refs(); ok { + _spec.SetField(gitattestation.FieldRefs, field.TypeJSON, value) + } + if value, ok := gau.mutation.AppendedRefs(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, gitattestation.FieldRefs, value) + }) + } + if value, ok := gau.mutation.Remotes(); ok { + _spec.SetField(gitattestation.FieldRemotes, field.TypeJSON, value) + } + if value, ok := gau.mutation.AppendedRemotes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, gitattestation.FieldRemotes, value) + }) + } + if gau.mutation.AttestationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: gitattestation.AttestationTable, + Columns: []string{gitattestation.AttestationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(attestation.FieldID, field.TypeUUID), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gau.mutation.AttestationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: gitattestation.AttestationTable, + Columns: []string{gitattestation.AttestationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(attestation.FieldID, field.TypeUUID), + }, + } + 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, gau.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{gitattestation.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + gau.mutation.done = true + return n, nil +} + +// GitAttestationUpdateOne is the builder for updating a single GitAttestation entity. +type GitAttestationUpdateOne struct { + config + fields []string + hooks []Hook + mutation *GitAttestationMutation +} + +// SetCommitHash sets the "commit_hash" field. +func (gauo *GitAttestationUpdateOne) SetCommitHash(s string) *GitAttestationUpdateOne { + gauo.mutation.SetCommitHash(s) + return gauo +} + +// SetNillableCommitHash sets the "commit_hash" field if the given value is not nil. +func (gauo *GitAttestationUpdateOne) SetNillableCommitHash(s *string) *GitAttestationUpdateOne { + if s != nil { + gauo.SetCommitHash(*s) + } + return gauo +} + +// SetAuthor sets the "author" field. +func (gauo *GitAttestationUpdateOne) SetAuthor(s string) *GitAttestationUpdateOne { + gauo.mutation.SetAuthor(s) + return gauo +} + +// SetNillableAuthor sets the "author" field if the given value is not nil. +func (gauo *GitAttestationUpdateOne) SetNillableAuthor(s *string) *GitAttestationUpdateOne { + if s != nil { + gauo.SetAuthor(*s) + } + return gauo +} + +// SetAuthorEmail sets the "author_email" field. +func (gauo *GitAttestationUpdateOne) SetAuthorEmail(s string) *GitAttestationUpdateOne { + gauo.mutation.SetAuthorEmail(s) + return gauo +} + +// SetNillableAuthorEmail sets the "author_email" field if the given value is not nil. +func (gauo *GitAttestationUpdateOne) SetNillableAuthorEmail(s *string) *GitAttestationUpdateOne { + if s != nil { + gauo.SetAuthorEmail(*s) + } + return gauo +} + +// SetCommitterName sets the "committer_name" field. +func (gauo *GitAttestationUpdateOne) SetCommitterName(s string) *GitAttestationUpdateOne { + gauo.mutation.SetCommitterName(s) + return gauo +} + +// SetNillableCommitterName sets the "committer_name" field if the given value is not nil. +func (gauo *GitAttestationUpdateOne) SetNillableCommitterName(s *string) *GitAttestationUpdateOne { + if s != nil { + gauo.SetCommitterName(*s) + } + return gauo +} + +// SetCommitterEmail sets the "committer_email" field. +func (gauo *GitAttestationUpdateOne) SetCommitterEmail(s string) *GitAttestationUpdateOne { + gauo.mutation.SetCommitterEmail(s) + return gauo +} + +// SetNillableCommitterEmail sets the "committer_email" field if the given value is not nil. +func (gauo *GitAttestationUpdateOne) SetNillableCommitterEmail(s *string) *GitAttestationUpdateOne { + if s != nil { + gauo.SetCommitterEmail(*s) + } + return gauo +} + +// SetCommitDate sets the "commit_date" field. +func (gauo *GitAttestationUpdateOne) SetCommitDate(s string) *GitAttestationUpdateOne { + gauo.mutation.SetCommitDate(s) + return gauo +} + +// SetNillableCommitDate sets the "commit_date" field if the given value is not nil. +func (gauo *GitAttestationUpdateOne) SetNillableCommitDate(s *string) *GitAttestationUpdateOne { + if s != nil { + gauo.SetCommitDate(*s) + } + return gauo +} + +// SetCommitMessage sets the "commit_message" field. +func (gauo *GitAttestationUpdateOne) SetCommitMessage(s string) *GitAttestationUpdateOne { + gauo.mutation.SetCommitMessage(s) + return gauo +} + +// SetNillableCommitMessage sets the "commit_message" field if the given value is not nil. +func (gauo *GitAttestationUpdateOne) SetNillableCommitMessage(s *string) *GitAttestationUpdateOne { + if s != nil { + gauo.SetCommitMessage(*s) + } + return gauo +} + +// SetStatus sets the "status" field. +func (gauo *GitAttestationUpdateOne) SetStatus(s []string) *GitAttestationUpdateOne { + gauo.mutation.SetStatus(s) + return gauo +} + +// AppendStatus appends s to the "status" field. +func (gauo *GitAttestationUpdateOne) AppendStatus(s []string) *GitAttestationUpdateOne { + gauo.mutation.AppendStatus(s) + return gauo +} + +// SetCommitType sets the "commit_type" field. +func (gauo *GitAttestationUpdateOne) SetCommitType(s string) *GitAttestationUpdateOne { + gauo.mutation.SetCommitType(s) + return gauo +} + +// SetNillableCommitType sets the "commit_type" field if the given value is not nil. +func (gauo *GitAttestationUpdateOne) SetNillableCommitType(s *string) *GitAttestationUpdateOne { + if s != nil { + gauo.SetCommitType(*s) + } + return gauo +} + +// SetCommitDigest sets the "commit_digest" field. +func (gauo *GitAttestationUpdateOne) SetCommitDigest(s string) *GitAttestationUpdateOne { + gauo.mutation.SetCommitDigest(s) + return gauo +} + +// SetNillableCommitDigest sets the "commit_digest" field if the given value is not nil. +func (gauo *GitAttestationUpdateOne) SetNillableCommitDigest(s *string) *GitAttestationUpdateOne { + if s != nil { + gauo.SetCommitDigest(*s) + } + return gauo +} + +// SetSignature sets the "signature" field. +func (gauo *GitAttestationUpdateOne) SetSignature(s string) *GitAttestationUpdateOne { + gauo.mutation.SetSignature(s) + return gauo +} + +// SetNillableSignature sets the "signature" field if the given value is not nil. +func (gauo *GitAttestationUpdateOne) SetNillableSignature(s *string) *GitAttestationUpdateOne { + if s != nil { + gauo.SetSignature(*s) + } + return gauo +} + +// SetParentHashes sets the "parent_hashes" field. +func (gauo *GitAttestationUpdateOne) SetParentHashes(s []string) *GitAttestationUpdateOne { + gauo.mutation.SetParentHashes(s) + return gauo +} + +// AppendParentHashes appends s to the "parent_hashes" field. +func (gauo *GitAttestationUpdateOne) AppendParentHashes(s []string) *GitAttestationUpdateOne { + gauo.mutation.AppendParentHashes(s) + return gauo +} + +// SetTreeHash sets the "tree_hash" field. +func (gauo *GitAttestationUpdateOne) SetTreeHash(s string) *GitAttestationUpdateOne { + gauo.mutation.SetTreeHash(s) + return gauo +} + +// SetNillableTreeHash sets the "tree_hash" field if the given value is not nil. +func (gauo *GitAttestationUpdateOne) SetNillableTreeHash(s *string) *GitAttestationUpdateOne { + if s != nil { + gauo.SetTreeHash(*s) + } + return gauo +} + +// SetRefs sets the "refs" field. +func (gauo *GitAttestationUpdateOne) SetRefs(s []string) *GitAttestationUpdateOne { + gauo.mutation.SetRefs(s) + return gauo +} + +// AppendRefs appends s to the "refs" field. +func (gauo *GitAttestationUpdateOne) AppendRefs(s []string) *GitAttestationUpdateOne { + gauo.mutation.AppendRefs(s) + return gauo +} + +// SetRemotes sets the "remotes" field. +func (gauo *GitAttestationUpdateOne) SetRemotes(s []string) *GitAttestationUpdateOne { + gauo.mutation.SetRemotes(s) + return gauo +} + +// AppendRemotes appends s to the "remotes" field. +func (gauo *GitAttestationUpdateOne) AppendRemotes(s []string) *GitAttestationUpdateOne { + gauo.mutation.AppendRemotes(s) + return gauo +} + +// SetAttestationID sets the "attestation" edge to the Attestation entity by ID. +func (gauo *GitAttestationUpdateOne) SetAttestationID(id uuid.UUID) *GitAttestationUpdateOne { + gauo.mutation.SetAttestationID(id) + return gauo +} + +// SetAttestation sets the "attestation" edge to the Attestation entity. +func (gauo *GitAttestationUpdateOne) SetAttestation(a *Attestation) *GitAttestationUpdateOne { + return gauo.SetAttestationID(a.ID) +} + +// Mutation returns the GitAttestationMutation object of the builder. +func (gauo *GitAttestationUpdateOne) Mutation() *GitAttestationMutation { + return gauo.mutation +} + +// ClearAttestation clears the "attestation" edge to the Attestation entity. +func (gauo *GitAttestationUpdateOne) ClearAttestation() *GitAttestationUpdateOne { + gauo.mutation.ClearAttestation() + return gauo +} + +// Where appends a list predicates to the GitAttestationUpdate builder. +func (gauo *GitAttestationUpdateOne) Where(ps ...predicate.GitAttestation) *GitAttestationUpdateOne { + gauo.mutation.Where(ps...) + return gauo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (gauo *GitAttestationUpdateOne) Select(field string, fields ...string) *GitAttestationUpdateOne { + gauo.fields = append([]string{field}, fields...) + return gauo +} + +// Save executes the query and returns the updated GitAttestation entity. +func (gauo *GitAttestationUpdateOne) Save(ctx context.Context) (*GitAttestation, error) { + return withHooks(ctx, gauo.sqlSave, gauo.mutation, gauo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (gauo *GitAttestationUpdateOne) SaveX(ctx context.Context) *GitAttestation { + node, err := gauo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (gauo *GitAttestationUpdateOne) Exec(ctx context.Context) error { + _, err := gauo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gauo *GitAttestationUpdateOne) ExecX(ctx context.Context) { + if err := gauo.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (gauo *GitAttestationUpdateOne) check() error { + if _, ok := gauo.mutation.AttestationID(); gauo.mutation.AttestationCleared() && !ok { + return errors.New(`ent: clearing a required unique edge "GitAttestation.attestation"`) + } + return nil +} + +func (gauo *GitAttestationUpdateOne) sqlSave(ctx context.Context) (_node *GitAttestation, err error) { + if err := gauo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(gitattestation.Table, gitattestation.Columns, sqlgraph.NewFieldSpec(gitattestation.FieldID, field.TypeUUID)) + id, ok := gauo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "GitAttestation.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := gauo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, gitattestation.FieldID) + for _, f := range fields { + if !gitattestation.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + if f != gitattestation.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := gauo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := gauo.mutation.CommitHash(); ok { + _spec.SetField(gitattestation.FieldCommitHash, field.TypeString, value) + } + if value, ok := gauo.mutation.Author(); ok { + _spec.SetField(gitattestation.FieldAuthor, field.TypeString, value) + } + if value, ok := gauo.mutation.AuthorEmail(); ok { + _spec.SetField(gitattestation.FieldAuthorEmail, field.TypeString, value) + } + if value, ok := gauo.mutation.CommitterName(); ok { + _spec.SetField(gitattestation.FieldCommitterName, field.TypeString, value) + } + if value, ok := gauo.mutation.CommitterEmail(); ok { + _spec.SetField(gitattestation.FieldCommitterEmail, field.TypeString, value) + } + if value, ok := gauo.mutation.CommitDate(); ok { + _spec.SetField(gitattestation.FieldCommitDate, field.TypeString, value) + } + if value, ok := gauo.mutation.CommitMessage(); ok { + _spec.SetField(gitattestation.FieldCommitMessage, field.TypeString, value) + } + if value, ok := gauo.mutation.Status(); ok { + _spec.SetField(gitattestation.FieldStatus, field.TypeJSON, value) + } + if value, ok := gauo.mutation.AppendedStatus(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, gitattestation.FieldStatus, value) + }) + } + if value, ok := gauo.mutation.CommitType(); ok { + _spec.SetField(gitattestation.FieldCommitType, field.TypeString, value) + } + if value, ok := gauo.mutation.CommitDigest(); ok { + _spec.SetField(gitattestation.FieldCommitDigest, field.TypeString, value) + } + if value, ok := gauo.mutation.Signature(); ok { + _spec.SetField(gitattestation.FieldSignature, field.TypeString, value) + } + if value, ok := gauo.mutation.ParentHashes(); ok { + _spec.SetField(gitattestation.FieldParentHashes, field.TypeJSON, value) + } + if value, ok := gauo.mutation.AppendedParentHashes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, gitattestation.FieldParentHashes, value) + }) + } + if value, ok := gauo.mutation.TreeHash(); ok { + _spec.SetField(gitattestation.FieldTreeHash, field.TypeString, value) + } + if value, ok := gauo.mutation.Refs(); ok { + _spec.SetField(gitattestation.FieldRefs, field.TypeJSON, value) + } + if value, ok := gauo.mutation.AppendedRefs(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, gitattestation.FieldRefs, value) + }) + } + if value, ok := gauo.mutation.Remotes(); ok { + _spec.SetField(gitattestation.FieldRemotes, field.TypeJSON, value) + } + if value, ok := gauo.mutation.AppendedRemotes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, gitattestation.FieldRemotes, value) + }) + } + if gauo.mutation.AttestationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: gitattestation.AttestationTable, + Columns: []string{gitattestation.AttestationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(attestation.FieldID, field.TypeUUID), + }, + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gauo.mutation.AttestationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: gitattestation.AttestationTable, + Columns: []string{gitattestation.AttestationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(attestation.FieldID, field.TypeUUID), + }, + } + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _node = &GitAttestation{config: gauo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, gauo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{gitattestation.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + gauo.mutation.done = true + return _node, nil +} diff --git a/ent/gql_collection.go b/ent/gql_collection.go index 3e298c66..9ef41aa1 100644 --- a/ent/gql_collection.go +++ b/ent/gql_collection.go @@ -15,6 +15,7 @@ import ( "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/gitattestation" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/signature" "github.com/in-toto/archivista/ent/statement" @@ -55,6 +56,17 @@ func (a *AttestationQuery) collectField(ctx context.Context, oneNode bool, opCtx return err } a.withAttestationCollection = query + + case "gitAttestation": + var ( + alias = field.Alias + path = append(path, alias) + query = (&GitAttestationClient{config: a.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, gitattestationImplementors)...); err != nil { + return err + } + a.withGitAttestation = query case "type": if _, ok := fieldSeen[attestation.FieldType]; !ok { selectedFields = append(selectedFields, attestation.FieldType) @@ -379,6 +391,154 @@ func newDssePaginateArgs(rv map[string]any) *dssePaginateArgs { return args } +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (ga *GitAttestationQuery) CollectFields(ctx context.Context, satisfies ...string) (*GitAttestationQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return ga, nil + } + if err := ga.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return ga, nil +} + +func (ga *GitAttestationQuery) collectField(ctx context.Context, oneNode bool, 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(gitattestation.Columns)) + selectedFields = []string{gitattestation.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "attestation": + var ( + alias = field.Alias + path = append(path, alias) + query = (&AttestationClient{config: ga.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, attestationImplementors)...); err != nil { + return err + } + ga.withAttestation = query + case "commitHash": + if _, ok := fieldSeen[gitattestation.FieldCommitHash]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldCommitHash) + fieldSeen[gitattestation.FieldCommitHash] = struct{}{} + } + case "author": + if _, ok := fieldSeen[gitattestation.FieldAuthor]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldAuthor) + fieldSeen[gitattestation.FieldAuthor] = struct{}{} + } + case "authorEmail": + if _, ok := fieldSeen[gitattestation.FieldAuthorEmail]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldAuthorEmail) + fieldSeen[gitattestation.FieldAuthorEmail] = struct{}{} + } + case "committerName": + if _, ok := fieldSeen[gitattestation.FieldCommitterName]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldCommitterName) + fieldSeen[gitattestation.FieldCommitterName] = struct{}{} + } + case "committerEmail": + if _, ok := fieldSeen[gitattestation.FieldCommitterEmail]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldCommitterEmail) + fieldSeen[gitattestation.FieldCommitterEmail] = struct{}{} + } + case "commitDate": + if _, ok := fieldSeen[gitattestation.FieldCommitDate]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldCommitDate) + fieldSeen[gitattestation.FieldCommitDate] = struct{}{} + } + case "commitMessage": + if _, ok := fieldSeen[gitattestation.FieldCommitMessage]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldCommitMessage) + fieldSeen[gitattestation.FieldCommitMessage] = struct{}{} + } + case "status": + if _, ok := fieldSeen[gitattestation.FieldStatus]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldStatus) + fieldSeen[gitattestation.FieldStatus] = struct{}{} + } + case "commitType": + if _, ok := fieldSeen[gitattestation.FieldCommitType]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldCommitType) + fieldSeen[gitattestation.FieldCommitType] = struct{}{} + } + case "commitDigest": + if _, ok := fieldSeen[gitattestation.FieldCommitDigest]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldCommitDigest) + fieldSeen[gitattestation.FieldCommitDigest] = struct{}{} + } + case "signature": + if _, ok := fieldSeen[gitattestation.FieldSignature]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldSignature) + fieldSeen[gitattestation.FieldSignature] = struct{}{} + } + case "parentHashes": + if _, ok := fieldSeen[gitattestation.FieldParentHashes]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldParentHashes) + fieldSeen[gitattestation.FieldParentHashes] = struct{}{} + } + case "treeHash": + if _, ok := fieldSeen[gitattestation.FieldTreeHash]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldTreeHash) + fieldSeen[gitattestation.FieldTreeHash] = struct{}{} + } + case "refs": + if _, ok := fieldSeen[gitattestation.FieldRefs]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldRefs) + fieldSeen[gitattestation.FieldRefs] = struct{}{} + } + case "remotes": + if _, ok := fieldSeen[gitattestation.FieldRemotes]; !ok { + selectedFields = append(selectedFields, gitattestation.FieldRemotes) + fieldSeen[gitattestation.FieldRemotes] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + ga.Select(selectedFields...) + } + return nil +} + +type gitattestationPaginateArgs struct { + first, last *int + after, before *Cursor + opts []GitAttestationPaginateOption +} + +func newGitAttestationPaginateArgs(rv map[string]any) *gitattestationPaginateArgs { + args := &gitattestationPaginateArgs{} + 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].(*GitAttestationWhereInput); ok { + args.opts = append(args.opts, WithGitAttestationFilter(v.Filter)) + } + return args +} + // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. func (pd *PayloadDigestQuery) CollectFields(ctx context.Context, satisfies ...string) (*PayloadDigestQuery, error) { fc := graphql.GetFieldContext(ctx) diff --git a/ent/gql_edge.go b/ent/gql_edge.go index 19957b71..22c1c3f3 100644 --- a/ent/gql_edge.go +++ b/ent/gql_edge.go @@ -16,6 +16,14 @@ func (a *Attestation) AttestationCollection(ctx context.Context) (*AttestationCo return result, err } +func (a *Attestation) GitAttestation(ctx context.Context) (*GitAttestation, error) { + result, err := a.Edges.GitAttestationOrErr() + if IsNotLoaded(err) { + result, err = a.QueryGitAttestation().Only(ctx) + } + return result, MaskNotFound(err) +} + func (ac *AttestationCollection) Attestations(ctx context.Context) (result []*Attestation, err error) { if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { result, err = ac.NamedAttestations(graphql.GetFieldContext(ctx).Field.Alias) @@ -76,6 +84,14 @@ func (d *Dsse) PayloadDigests(ctx context.Context) (result []*PayloadDigest, err return result, err } +func (ga *GitAttestation) Attestation(ctx context.Context) (*Attestation, error) { + result, err := ga.Edges.AttestationOrErr() + if IsNotLoaded(err) { + result, err = ga.QueryAttestation().Only(ctx) + } + return result, err +} + func (pd *PayloadDigest) Dsse(ctx context.Context) (*Dsse, error) { result, err := pd.Edges.DsseOrErr() if IsNotLoaded(err) { diff --git a/ent/gql_node.go b/ent/gql_node.go index 3010c131..5f5bc33c 100644 --- a/ent/gql_node.go +++ b/ent/gql_node.go @@ -14,6 +14,7 @@ import ( "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/gitattestation" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/signature" "github.com/in-toto/archivista/ent/statement" @@ -47,6 +48,11 @@ var dsseImplementors = []string{"Dsse", "Node"} // IsNode implements the Node interface check for GQLGen. func (*Dsse) IsNode() {} +var gitattestationImplementors = []string{"GitAttestation", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*GitAttestation) IsNode() {} + var payloaddigestImplementors = []string{"PayloadDigest", "Node"} // IsNode implements the Node interface check for GQLGen. @@ -171,6 +177,15 @@ func (c *Client) noder(ctx context.Context, table string, id uuid.UUID) (Noder, } } return query.Only(ctx) + case gitattestation.Table: + query := c.GitAttestation.Query(). + Where(gitattestation.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, gitattestationImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) case payloaddigest.Table: query := c.PayloadDigest.Query(). Where(payloaddigest.ID(id)) @@ -362,6 +377,22 @@ func (c *Client) noders(ctx context.Context, table string, ids []uuid.UUID) ([]N *noder = node } } + case gitattestation.Table: + query := c.GitAttestation.Query(). + Where(gitattestation.IDIn(ids...)) + query, err := query.CollectFields(ctx, gitattestationImplementors...) + 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 payloaddigest.Table: query := c.PayloadDigest.Query(). Where(payloaddigest.IDIn(ids...)) diff --git a/ent/gql_pagination.go b/ent/gql_pagination.go index b710cac8..f08624f5 100644 --- a/ent/gql_pagination.go +++ b/ent/gql_pagination.go @@ -16,6 +16,7 @@ import ( "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/gitattestation" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/signature" "github.com/in-toto/archivista/ent/statement" @@ -1101,6 +1102,255 @@ func (d *Dsse) ToEdge(order *DsseOrder) *DsseEdge { } } +// GitAttestationEdge is the edge representation of GitAttestation. +type GitAttestationEdge struct { + Node *GitAttestation `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// GitAttestationConnection is the connection containing edges to GitAttestation. +type GitAttestationConnection struct { + Edges []*GitAttestationEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *GitAttestationConnection) build(nodes []*GitAttestation, pager *gitattestationPager, 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) *GitAttestation + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *GitAttestation { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *GitAttestation { + return nodes[i] + } + } + c.Edges = make([]*GitAttestationEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &GitAttestationEdge{ + 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) + } +} + +// GitAttestationPaginateOption enables pagination customization. +type GitAttestationPaginateOption func(*gitattestationPager) error + +// WithGitAttestationOrder configures pagination ordering. +func WithGitAttestationOrder(order *GitAttestationOrder) GitAttestationPaginateOption { + if order == nil { + order = DefaultGitAttestationOrder + } + o := *order + return func(pager *gitattestationPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultGitAttestationOrder.Field + } + pager.order = &o + return nil + } +} + +// WithGitAttestationFilter configures pagination filter. +func WithGitAttestationFilter(filter func(*GitAttestationQuery) (*GitAttestationQuery, error)) GitAttestationPaginateOption { + return func(pager *gitattestationPager) error { + if filter == nil { + return errors.New("GitAttestationQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type gitattestationPager struct { + reverse bool + order *GitAttestationOrder + filter func(*GitAttestationQuery) (*GitAttestationQuery, error) +} + +func newGitAttestationPager(opts []GitAttestationPaginateOption, reverse bool) (*gitattestationPager, error) { + pager := &gitattestationPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultGitAttestationOrder + } + return pager, nil +} + +func (p *gitattestationPager) applyFilter(query *GitAttestationQuery) (*GitAttestationQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *gitattestationPager) toCursor(ga *GitAttestation) Cursor { + return p.order.Field.toCursor(ga) +} + +func (p *gitattestationPager) applyCursors(query *GitAttestationQuery, after, before *Cursor) (*GitAttestationQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultGitAttestationOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *gitattestationPager) applyOrder(query *GitAttestationQuery) *GitAttestationQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultGitAttestationOrder.Field { + query = query.Order(DefaultGitAttestationOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *gitattestationPager) orderExpr(query *GitAttestationQuery) 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 != DefaultGitAttestationOrder.Field { + b.Comma().Ident(DefaultGitAttestationOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to GitAttestation. +func (ga *GitAttestationQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...GitAttestationPaginateOption, +) (*GitAttestationConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newGitAttestationPager(opts, last != nil) + if err != nil { + return nil, err + } + if ga, err = pager.applyFilter(ga); err != nil { + return nil, err + } + conn := &GitAttestationConnection{Edges: []*GitAttestationEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := ga.Clone() + c.ctx.Fields = nil + if conn.TotalCount, err = c.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 ga, err = pager.applyCursors(ga, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + ga.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := ga.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + ga = pager.applyOrder(ga) + nodes, err := ga.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// GitAttestationOrderField defines the ordering field of GitAttestation. +type GitAttestationOrderField struct { + // Value extracts the ordering value from the given GitAttestation. + Value func(*GitAttestation) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) gitattestation.OrderOption + toCursor func(*GitAttestation) Cursor +} + +// GitAttestationOrder defines the ordering of GitAttestation. +type GitAttestationOrder struct { + Direction OrderDirection `json:"direction"` + Field *GitAttestationOrderField `json:"field"` +} + +// DefaultGitAttestationOrder is the default ordering of GitAttestation. +var DefaultGitAttestationOrder = &GitAttestationOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &GitAttestationOrderField{ + Value: func(ga *GitAttestation) (ent.Value, error) { + return ga.ID, nil + }, + column: gitattestation.FieldID, + toTerm: gitattestation.ByID, + toCursor: func(ga *GitAttestation) Cursor { + return Cursor{ID: ga.ID} + }, + }, +} + +// ToEdge converts GitAttestation into GitAttestationEdge. +func (ga *GitAttestation) ToEdge(order *GitAttestationOrder) *GitAttestationEdge { + if order == nil { + order = DefaultGitAttestationOrder + } + return &GitAttestationEdge{ + Node: ga, + Cursor: order.Field.toCursor(ga), + } +} + // PayloadDigestEdge is the edge representation of PayloadDigest. type PayloadDigestEdge struct { Node *PayloadDigest `json:"node"` diff --git a/ent/gql_where_input.go b/ent/gql_where_input.go index 7f1b1135..3df7d04b 100644 --- a/ent/gql_where_input.go +++ b/ent/gql_where_input.go @@ -12,6 +12,7 @@ import ( "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/gitattestation" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/predicate" "github.com/in-toto/archivista/ent/signature" @@ -56,6 +57,10 @@ type AttestationWhereInput struct { // "attestation_collection" edge predicates. HasAttestationCollection *bool `json:"hasAttestationCollection,omitempty"` HasAttestationCollectionWith []*AttestationCollectionWhereInput `json:"hasAttestationCollectionWith,omitempty"` + + // "git_attestation" edge predicates. + HasGitAttestation *bool `json:"hasGitAttestation,omitempty"` + HasGitAttestationWith []*GitAttestationWhereInput `json:"hasGitAttestationWith,omitempty"` } // AddPredicates adds custom predicates to the where input to be used during the filtering phase. @@ -211,6 +216,24 @@ func (i *AttestationWhereInput) P() (predicate.Attestation, error) { } predicates = append(predicates, attestation.HasAttestationCollectionWith(with...)) } + if i.HasGitAttestation != nil { + p := attestation.HasGitAttestation() + if !*i.HasGitAttestation { + p = attestation.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasGitAttestationWith) > 0 { + with := make([]predicate.GitAttestation, 0, len(i.HasGitAttestationWith)) + for _, w := range i.HasGitAttestationWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasGitAttestationWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, attestation.HasGitAttestationWith(with...)) + } switch len(predicates) { case 0: return nil, ErrEmptyAttestationWhereInput @@ -941,6 +964,746 @@ func (i *DsseWhereInput) P() (predicate.Dsse, error) { } } +// GitAttestationWhereInput represents a where input for filtering GitAttestation queries. +type GitAttestationWhereInput struct { + Predicates []predicate.GitAttestation `json:"-"` + Not *GitAttestationWhereInput `json:"not,omitempty"` + Or []*GitAttestationWhereInput `json:"or,omitempty"` + And []*GitAttestationWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *uuid.UUID `json:"id,omitempty"` + IDNEQ *uuid.UUID `json:"idNEQ,omitempty"` + IDIn []uuid.UUID `json:"idIn,omitempty"` + IDNotIn []uuid.UUID `json:"idNotIn,omitempty"` + IDGT *uuid.UUID `json:"idGT,omitempty"` + IDGTE *uuid.UUID `json:"idGTE,omitempty"` + IDLT *uuid.UUID `json:"idLT,omitempty"` + IDLTE *uuid.UUID `json:"idLTE,omitempty"` + + // "commit_hash" field predicates. + CommitHash *string `json:"commitHash,omitempty"` + CommitHashNEQ *string `json:"commitHashNEQ,omitempty"` + CommitHashIn []string `json:"commitHashIn,omitempty"` + CommitHashNotIn []string `json:"commitHashNotIn,omitempty"` + CommitHashGT *string `json:"commitHashGT,omitempty"` + CommitHashGTE *string `json:"commitHashGTE,omitempty"` + CommitHashLT *string `json:"commitHashLT,omitempty"` + CommitHashLTE *string `json:"commitHashLTE,omitempty"` + CommitHashContains *string `json:"commitHashContains,omitempty"` + CommitHashHasPrefix *string `json:"commitHashHasPrefix,omitempty"` + CommitHashHasSuffix *string `json:"commitHashHasSuffix,omitempty"` + CommitHashEqualFold *string `json:"commitHashEqualFold,omitempty"` + CommitHashContainsFold *string `json:"commitHashContainsFold,omitempty"` + + // "author" field predicates. + Author *string `json:"author,omitempty"` + AuthorNEQ *string `json:"authorNEQ,omitempty"` + AuthorIn []string `json:"authorIn,omitempty"` + AuthorNotIn []string `json:"authorNotIn,omitempty"` + AuthorGT *string `json:"authorGT,omitempty"` + AuthorGTE *string `json:"authorGTE,omitempty"` + AuthorLT *string `json:"authorLT,omitempty"` + AuthorLTE *string `json:"authorLTE,omitempty"` + AuthorContains *string `json:"authorContains,omitempty"` + AuthorHasPrefix *string `json:"authorHasPrefix,omitempty"` + AuthorHasSuffix *string `json:"authorHasSuffix,omitempty"` + AuthorEqualFold *string `json:"authorEqualFold,omitempty"` + AuthorContainsFold *string `json:"authorContainsFold,omitempty"` + + // "author_email" field predicates. + AuthorEmail *string `json:"authorEmail,omitempty"` + AuthorEmailNEQ *string `json:"authorEmailNEQ,omitempty"` + AuthorEmailIn []string `json:"authorEmailIn,omitempty"` + AuthorEmailNotIn []string `json:"authorEmailNotIn,omitempty"` + AuthorEmailGT *string `json:"authorEmailGT,omitempty"` + AuthorEmailGTE *string `json:"authorEmailGTE,omitempty"` + AuthorEmailLT *string `json:"authorEmailLT,omitempty"` + AuthorEmailLTE *string `json:"authorEmailLTE,omitempty"` + AuthorEmailContains *string `json:"authorEmailContains,omitempty"` + AuthorEmailHasPrefix *string `json:"authorEmailHasPrefix,omitempty"` + AuthorEmailHasSuffix *string `json:"authorEmailHasSuffix,omitempty"` + AuthorEmailEqualFold *string `json:"authorEmailEqualFold,omitempty"` + AuthorEmailContainsFold *string `json:"authorEmailContainsFold,omitempty"` + + // "committer_name" field predicates. + CommitterName *string `json:"committerName,omitempty"` + CommitterNameNEQ *string `json:"committerNameNEQ,omitempty"` + CommitterNameIn []string `json:"committerNameIn,omitempty"` + CommitterNameNotIn []string `json:"committerNameNotIn,omitempty"` + CommitterNameGT *string `json:"committerNameGT,omitempty"` + CommitterNameGTE *string `json:"committerNameGTE,omitempty"` + CommitterNameLT *string `json:"committerNameLT,omitempty"` + CommitterNameLTE *string `json:"committerNameLTE,omitempty"` + CommitterNameContains *string `json:"committerNameContains,omitempty"` + CommitterNameHasPrefix *string `json:"committerNameHasPrefix,omitempty"` + CommitterNameHasSuffix *string `json:"committerNameHasSuffix,omitempty"` + CommitterNameEqualFold *string `json:"committerNameEqualFold,omitempty"` + CommitterNameContainsFold *string `json:"committerNameContainsFold,omitempty"` + + // "committer_email" field predicates. + CommitterEmail *string `json:"committerEmail,omitempty"` + CommitterEmailNEQ *string `json:"committerEmailNEQ,omitempty"` + CommitterEmailIn []string `json:"committerEmailIn,omitempty"` + CommitterEmailNotIn []string `json:"committerEmailNotIn,omitempty"` + CommitterEmailGT *string `json:"committerEmailGT,omitempty"` + CommitterEmailGTE *string `json:"committerEmailGTE,omitempty"` + CommitterEmailLT *string `json:"committerEmailLT,omitempty"` + CommitterEmailLTE *string `json:"committerEmailLTE,omitempty"` + CommitterEmailContains *string `json:"committerEmailContains,omitempty"` + CommitterEmailHasPrefix *string `json:"committerEmailHasPrefix,omitempty"` + CommitterEmailHasSuffix *string `json:"committerEmailHasSuffix,omitempty"` + CommitterEmailEqualFold *string `json:"committerEmailEqualFold,omitempty"` + CommitterEmailContainsFold *string `json:"committerEmailContainsFold,omitempty"` + + // "commit_date" field predicates. + CommitDate *string `json:"commitDate,omitempty"` + CommitDateNEQ *string `json:"commitDateNEQ,omitempty"` + CommitDateIn []string `json:"commitDateIn,omitempty"` + CommitDateNotIn []string `json:"commitDateNotIn,omitempty"` + CommitDateGT *string `json:"commitDateGT,omitempty"` + CommitDateGTE *string `json:"commitDateGTE,omitempty"` + CommitDateLT *string `json:"commitDateLT,omitempty"` + CommitDateLTE *string `json:"commitDateLTE,omitempty"` + CommitDateContains *string `json:"commitDateContains,omitempty"` + CommitDateHasPrefix *string `json:"commitDateHasPrefix,omitempty"` + CommitDateHasSuffix *string `json:"commitDateHasSuffix,omitempty"` + CommitDateEqualFold *string `json:"commitDateEqualFold,omitempty"` + CommitDateContainsFold *string `json:"commitDateContainsFold,omitempty"` + + // "commit_message" field predicates. + CommitMessage *string `json:"commitMessage,omitempty"` + CommitMessageNEQ *string `json:"commitMessageNEQ,omitempty"` + CommitMessageIn []string `json:"commitMessageIn,omitempty"` + CommitMessageNotIn []string `json:"commitMessageNotIn,omitempty"` + CommitMessageGT *string `json:"commitMessageGT,omitempty"` + CommitMessageGTE *string `json:"commitMessageGTE,omitempty"` + CommitMessageLT *string `json:"commitMessageLT,omitempty"` + CommitMessageLTE *string `json:"commitMessageLTE,omitempty"` + CommitMessageContains *string `json:"commitMessageContains,omitempty"` + CommitMessageHasPrefix *string `json:"commitMessageHasPrefix,omitempty"` + CommitMessageHasSuffix *string `json:"commitMessageHasSuffix,omitempty"` + CommitMessageEqualFold *string `json:"commitMessageEqualFold,omitempty"` + CommitMessageContainsFold *string `json:"commitMessageContainsFold,omitempty"` + + // "commit_type" field predicates. + CommitType *string `json:"commitType,omitempty"` + CommitTypeNEQ *string `json:"commitTypeNEQ,omitempty"` + CommitTypeIn []string `json:"commitTypeIn,omitempty"` + CommitTypeNotIn []string `json:"commitTypeNotIn,omitempty"` + CommitTypeGT *string `json:"commitTypeGT,omitempty"` + CommitTypeGTE *string `json:"commitTypeGTE,omitempty"` + CommitTypeLT *string `json:"commitTypeLT,omitempty"` + CommitTypeLTE *string `json:"commitTypeLTE,omitempty"` + CommitTypeContains *string `json:"commitTypeContains,omitempty"` + CommitTypeHasPrefix *string `json:"commitTypeHasPrefix,omitempty"` + CommitTypeHasSuffix *string `json:"commitTypeHasSuffix,omitempty"` + CommitTypeEqualFold *string `json:"commitTypeEqualFold,omitempty"` + CommitTypeContainsFold *string `json:"commitTypeContainsFold,omitempty"` + + // "commit_digest" field predicates. + CommitDigest *string `json:"commitDigest,omitempty"` + CommitDigestNEQ *string `json:"commitDigestNEQ,omitempty"` + CommitDigestIn []string `json:"commitDigestIn,omitempty"` + CommitDigestNotIn []string `json:"commitDigestNotIn,omitempty"` + CommitDigestGT *string `json:"commitDigestGT,omitempty"` + CommitDigestGTE *string `json:"commitDigestGTE,omitempty"` + CommitDigestLT *string `json:"commitDigestLT,omitempty"` + CommitDigestLTE *string `json:"commitDigestLTE,omitempty"` + CommitDigestContains *string `json:"commitDigestContains,omitempty"` + CommitDigestHasPrefix *string `json:"commitDigestHasPrefix,omitempty"` + CommitDigestHasSuffix *string `json:"commitDigestHasSuffix,omitempty"` + CommitDigestEqualFold *string `json:"commitDigestEqualFold,omitempty"` + CommitDigestContainsFold *string `json:"commitDigestContainsFold,omitempty"` + + // "signature" field predicates. + Signature *string `json:"signature,omitempty"` + SignatureNEQ *string `json:"signatureNEQ,omitempty"` + SignatureIn []string `json:"signatureIn,omitempty"` + SignatureNotIn []string `json:"signatureNotIn,omitempty"` + SignatureGT *string `json:"signatureGT,omitempty"` + SignatureGTE *string `json:"signatureGTE,omitempty"` + SignatureLT *string `json:"signatureLT,omitempty"` + SignatureLTE *string `json:"signatureLTE,omitempty"` + SignatureContains *string `json:"signatureContains,omitempty"` + SignatureHasPrefix *string `json:"signatureHasPrefix,omitempty"` + SignatureHasSuffix *string `json:"signatureHasSuffix,omitempty"` + SignatureEqualFold *string `json:"signatureEqualFold,omitempty"` + SignatureContainsFold *string `json:"signatureContainsFold,omitempty"` + + // "tree_hash" field predicates. + TreeHash *string `json:"treeHash,omitempty"` + TreeHashNEQ *string `json:"treeHashNEQ,omitempty"` + TreeHashIn []string `json:"treeHashIn,omitempty"` + TreeHashNotIn []string `json:"treeHashNotIn,omitempty"` + TreeHashGT *string `json:"treeHashGT,omitempty"` + TreeHashGTE *string `json:"treeHashGTE,omitempty"` + TreeHashLT *string `json:"treeHashLT,omitempty"` + TreeHashLTE *string `json:"treeHashLTE,omitempty"` + TreeHashContains *string `json:"treeHashContains,omitempty"` + TreeHashHasPrefix *string `json:"treeHashHasPrefix,omitempty"` + TreeHashHasSuffix *string `json:"treeHashHasSuffix,omitempty"` + TreeHashEqualFold *string `json:"treeHashEqualFold,omitempty"` + TreeHashContainsFold *string `json:"treeHashContainsFold,omitempty"` + + // "attestation" edge predicates. + HasAttestation *bool `json:"hasAttestation,omitempty"` + HasAttestationWith []*AttestationWhereInput `json:"hasAttestationWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *GitAttestationWhereInput) AddPredicates(predicates ...predicate.GitAttestation) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the GitAttestationWhereInput filter on the GitAttestationQuery builder. +func (i *GitAttestationWhereInput) Filter(q *GitAttestationQuery) (*GitAttestationQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyGitAttestationWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyGitAttestationWhereInput is returned in case the GitAttestationWhereInput is empty. +var ErrEmptyGitAttestationWhereInput = errors.New("ent: empty predicate GitAttestationWhereInput") + +// P returns a predicate for filtering gitattestations. +// An error is returned if the input is empty or invalid. +func (i *GitAttestationWhereInput) P() (predicate.GitAttestation, error) { + var predicates []predicate.GitAttestation + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, gitattestation.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.GitAttestation, 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, gitattestation.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.GitAttestation, 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, gitattestation.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, gitattestation.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, gitattestation.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, gitattestation.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, gitattestation.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, gitattestation.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, gitattestation.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, gitattestation.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, gitattestation.IDLTE(*i.IDLTE)) + } + if i.CommitHash != nil { + predicates = append(predicates, gitattestation.CommitHashEQ(*i.CommitHash)) + } + if i.CommitHashNEQ != nil { + predicates = append(predicates, gitattestation.CommitHashNEQ(*i.CommitHashNEQ)) + } + if len(i.CommitHashIn) > 0 { + predicates = append(predicates, gitattestation.CommitHashIn(i.CommitHashIn...)) + } + if len(i.CommitHashNotIn) > 0 { + predicates = append(predicates, gitattestation.CommitHashNotIn(i.CommitHashNotIn...)) + } + if i.CommitHashGT != nil { + predicates = append(predicates, gitattestation.CommitHashGT(*i.CommitHashGT)) + } + if i.CommitHashGTE != nil { + predicates = append(predicates, gitattestation.CommitHashGTE(*i.CommitHashGTE)) + } + if i.CommitHashLT != nil { + predicates = append(predicates, gitattestation.CommitHashLT(*i.CommitHashLT)) + } + if i.CommitHashLTE != nil { + predicates = append(predicates, gitattestation.CommitHashLTE(*i.CommitHashLTE)) + } + if i.CommitHashContains != nil { + predicates = append(predicates, gitattestation.CommitHashContains(*i.CommitHashContains)) + } + if i.CommitHashHasPrefix != nil { + predicates = append(predicates, gitattestation.CommitHashHasPrefix(*i.CommitHashHasPrefix)) + } + if i.CommitHashHasSuffix != nil { + predicates = append(predicates, gitattestation.CommitHashHasSuffix(*i.CommitHashHasSuffix)) + } + if i.CommitHashEqualFold != nil { + predicates = append(predicates, gitattestation.CommitHashEqualFold(*i.CommitHashEqualFold)) + } + if i.CommitHashContainsFold != nil { + predicates = append(predicates, gitattestation.CommitHashContainsFold(*i.CommitHashContainsFold)) + } + if i.Author != nil { + predicates = append(predicates, gitattestation.AuthorEQ(*i.Author)) + } + if i.AuthorNEQ != nil { + predicates = append(predicates, gitattestation.AuthorNEQ(*i.AuthorNEQ)) + } + if len(i.AuthorIn) > 0 { + predicates = append(predicates, gitattestation.AuthorIn(i.AuthorIn...)) + } + if len(i.AuthorNotIn) > 0 { + predicates = append(predicates, gitattestation.AuthorNotIn(i.AuthorNotIn...)) + } + if i.AuthorGT != nil { + predicates = append(predicates, gitattestation.AuthorGT(*i.AuthorGT)) + } + if i.AuthorGTE != nil { + predicates = append(predicates, gitattestation.AuthorGTE(*i.AuthorGTE)) + } + if i.AuthorLT != nil { + predicates = append(predicates, gitattestation.AuthorLT(*i.AuthorLT)) + } + if i.AuthorLTE != nil { + predicates = append(predicates, gitattestation.AuthorLTE(*i.AuthorLTE)) + } + if i.AuthorContains != nil { + predicates = append(predicates, gitattestation.AuthorContains(*i.AuthorContains)) + } + if i.AuthorHasPrefix != nil { + predicates = append(predicates, gitattestation.AuthorHasPrefix(*i.AuthorHasPrefix)) + } + if i.AuthorHasSuffix != nil { + predicates = append(predicates, gitattestation.AuthorHasSuffix(*i.AuthorHasSuffix)) + } + if i.AuthorEqualFold != nil { + predicates = append(predicates, gitattestation.AuthorEqualFold(*i.AuthorEqualFold)) + } + if i.AuthorContainsFold != nil { + predicates = append(predicates, gitattestation.AuthorContainsFold(*i.AuthorContainsFold)) + } + if i.AuthorEmail != nil { + predicates = append(predicates, gitattestation.AuthorEmailEQ(*i.AuthorEmail)) + } + if i.AuthorEmailNEQ != nil { + predicates = append(predicates, gitattestation.AuthorEmailNEQ(*i.AuthorEmailNEQ)) + } + if len(i.AuthorEmailIn) > 0 { + predicates = append(predicates, gitattestation.AuthorEmailIn(i.AuthorEmailIn...)) + } + if len(i.AuthorEmailNotIn) > 0 { + predicates = append(predicates, gitattestation.AuthorEmailNotIn(i.AuthorEmailNotIn...)) + } + if i.AuthorEmailGT != nil { + predicates = append(predicates, gitattestation.AuthorEmailGT(*i.AuthorEmailGT)) + } + if i.AuthorEmailGTE != nil { + predicates = append(predicates, gitattestation.AuthorEmailGTE(*i.AuthorEmailGTE)) + } + if i.AuthorEmailLT != nil { + predicates = append(predicates, gitattestation.AuthorEmailLT(*i.AuthorEmailLT)) + } + if i.AuthorEmailLTE != nil { + predicates = append(predicates, gitattestation.AuthorEmailLTE(*i.AuthorEmailLTE)) + } + if i.AuthorEmailContains != nil { + predicates = append(predicates, gitattestation.AuthorEmailContains(*i.AuthorEmailContains)) + } + if i.AuthorEmailHasPrefix != nil { + predicates = append(predicates, gitattestation.AuthorEmailHasPrefix(*i.AuthorEmailHasPrefix)) + } + if i.AuthorEmailHasSuffix != nil { + predicates = append(predicates, gitattestation.AuthorEmailHasSuffix(*i.AuthorEmailHasSuffix)) + } + if i.AuthorEmailEqualFold != nil { + predicates = append(predicates, gitattestation.AuthorEmailEqualFold(*i.AuthorEmailEqualFold)) + } + if i.AuthorEmailContainsFold != nil { + predicates = append(predicates, gitattestation.AuthorEmailContainsFold(*i.AuthorEmailContainsFold)) + } + if i.CommitterName != nil { + predicates = append(predicates, gitattestation.CommitterNameEQ(*i.CommitterName)) + } + if i.CommitterNameNEQ != nil { + predicates = append(predicates, gitattestation.CommitterNameNEQ(*i.CommitterNameNEQ)) + } + if len(i.CommitterNameIn) > 0 { + predicates = append(predicates, gitattestation.CommitterNameIn(i.CommitterNameIn...)) + } + if len(i.CommitterNameNotIn) > 0 { + predicates = append(predicates, gitattestation.CommitterNameNotIn(i.CommitterNameNotIn...)) + } + if i.CommitterNameGT != nil { + predicates = append(predicates, gitattestation.CommitterNameGT(*i.CommitterNameGT)) + } + if i.CommitterNameGTE != nil { + predicates = append(predicates, gitattestation.CommitterNameGTE(*i.CommitterNameGTE)) + } + if i.CommitterNameLT != nil { + predicates = append(predicates, gitattestation.CommitterNameLT(*i.CommitterNameLT)) + } + if i.CommitterNameLTE != nil { + predicates = append(predicates, gitattestation.CommitterNameLTE(*i.CommitterNameLTE)) + } + if i.CommitterNameContains != nil { + predicates = append(predicates, gitattestation.CommitterNameContains(*i.CommitterNameContains)) + } + if i.CommitterNameHasPrefix != nil { + predicates = append(predicates, gitattestation.CommitterNameHasPrefix(*i.CommitterNameHasPrefix)) + } + if i.CommitterNameHasSuffix != nil { + predicates = append(predicates, gitattestation.CommitterNameHasSuffix(*i.CommitterNameHasSuffix)) + } + if i.CommitterNameEqualFold != nil { + predicates = append(predicates, gitattestation.CommitterNameEqualFold(*i.CommitterNameEqualFold)) + } + if i.CommitterNameContainsFold != nil { + predicates = append(predicates, gitattestation.CommitterNameContainsFold(*i.CommitterNameContainsFold)) + } + if i.CommitterEmail != nil { + predicates = append(predicates, gitattestation.CommitterEmailEQ(*i.CommitterEmail)) + } + if i.CommitterEmailNEQ != nil { + predicates = append(predicates, gitattestation.CommitterEmailNEQ(*i.CommitterEmailNEQ)) + } + if len(i.CommitterEmailIn) > 0 { + predicates = append(predicates, gitattestation.CommitterEmailIn(i.CommitterEmailIn...)) + } + if len(i.CommitterEmailNotIn) > 0 { + predicates = append(predicates, gitattestation.CommitterEmailNotIn(i.CommitterEmailNotIn...)) + } + if i.CommitterEmailGT != nil { + predicates = append(predicates, gitattestation.CommitterEmailGT(*i.CommitterEmailGT)) + } + if i.CommitterEmailGTE != nil { + predicates = append(predicates, gitattestation.CommitterEmailGTE(*i.CommitterEmailGTE)) + } + if i.CommitterEmailLT != nil { + predicates = append(predicates, gitattestation.CommitterEmailLT(*i.CommitterEmailLT)) + } + if i.CommitterEmailLTE != nil { + predicates = append(predicates, gitattestation.CommitterEmailLTE(*i.CommitterEmailLTE)) + } + if i.CommitterEmailContains != nil { + predicates = append(predicates, gitattestation.CommitterEmailContains(*i.CommitterEmailContains)) + } + if i.CommitterEmailHasPrefix != nil { + predicates = append(predicates, gitattestation.CommitterEmailHasPrefix(*i.CommitterEmailHasPrefix)) + } + if i.CommitterEmailHasSuffix != nil { + predicates = append(predicates, gitattestation.CommitterEmailHasSuffix(*i.CommitterEmailHasSuffix)) + } + if i.CommitterEmailEqualFold != nil { + predicates = append(predicates, gitattestation.CommitterEmailEqualFold(*i.CommitterEmailEqualFold)) + } + if i.CommitterEmailContainsFold != nil { + predicates = append(predicates, gitattestation.CommitterEmailContainsFold(*i.CommitterEmailContainsFold)) + } + if i.CommitDate != nil { + predicates = append(predicates, gitattestation.CommitDateEQ(*i.CommitDate)) + } + if i.CommitDateNEQ != nil { + predicates = append(predicates, gitattestation.CommitDateNEQ(*i.CommitDateNEQ)) + } + if len(i.CommitDateIn) > 0 { + predicates = append(predicates, gitattestation.CommitDateIn(i.CommitDateIn...)) + } + if len(i.CommitDateNotIn) > 0 { + predicates = append(predicates, gitattestation.CommitDateNotIn(i.CommitDateNotIn...)) + } + if i.CommitDateGT != nil { + predicates = append(predicates, gitattestation.CommitDateGT(*i.CommitDateGT)) + } + if i.CommitDateGTE != nil { + predicates = append(predicates, gitattestation.CommitDateGTE(*i.CommitDateGTE)) + } + if i.CommitDateLT != nil { + predicates = append(predicates, gitattestation.CommitDateLT(*i.CommitDateLT)) + } + if i.CommitDateLTE != nil { + predicates = append(predicates, gitattestation.CommitDateLTE(*i.CommitDateLTE)) + } + if i.CommitDateContains != nil { + predicates = append(predicates, gitattestation.CommitDateContains(*i.CommitDateContains)) + } + if i.CommitDateHasPrefix != nil { + predicates = append(predicates, gitattestation.CommitDateHasPrefix(*i.CommitDateHasPrefix)) + } + if i.CommitDateHasSuffix != nil { + predicates = append(predicates, gitattestation.CommitDateHasSuffix(*i.CommitDateHasSuffix)) + } + if i.CommitDateEqualFold != nil { + predicates = append(predicates, gitattestation.CommitDateEqualFold(*i.CommitDateEqualFold)) + } + if i.CommitDateContainsFold != nil { + predicates = append(predicates, gitattestation.CommitDateContainsFold(*i.CommitDateContainsFold)) + } + if i.CommitMessage != nil { + predicates = append(predicates, gitattestation.CommitMessageEQ(*i.CommitMessage)) + } + if i.CommitMessageNEQ != nil { + predicates = append(predicates, gitattestation.CommitMessageNEQ(*i.CommitMessageNEQ)) + } + if len(i.CommitMessageIn) > 0 { + predicates = append(predicates, gitattestation.CommitMessageIn(i.CommitMessageIn...)) + } + if len(i.CommitMessageNotIn) > 0 { + predicates = append(predicates, gitattestation.CommitMessageNotIn(i.CommitMessageNotIn...)) + } + if i.CommitMessageGT != nil { + predicates = append(predicates, gitattestation.CommitMessageGT(*i.CommitMessageGT)) + } + if i.CommitMessageGTE != nil { + predicates = append(predicates, gitattestation.CommitMessageGTE(*i.CommitMessageGTE)) + } + if i.CommitMessageLT != nil { + predicates = append(predicates, gitattestation.CommitMessageLT(*i.CommitMessageLT)) + } + if i.CommitMessageLTE != nil { + predicates = append(predicates, gitattestation.CommitMessageLTE(*i.CommitMessageLTE)) + } + if i.CommitMessageContains != nil { + predicates = append(predicates, gitattestation.CommitMessageContains(*i.CommitMessageContains)) + } + if i.CommitMessageHasPrefix != nil { + predicates = append(predicates, gitattestation.CommitMessageHasPrefix(*i.CommitMessageHasPrefix)) + } + if i.CommitMessageHasSuffix != nil { + predicates = append(predicates, gitattestation.CommitMessageHasSuffix(*i.CommitMessageHasSuffix)) + } + if i.CommitMessageEqualFold != nil { + predicates = append(predicates, gitattestation.CommitMessageEqualFold(*i.CommitMessageEqualFold)) + } + if i.CommitMessageContainsFold != nil { + predicates = append(predicates, gitattestation.CommitMessageContainsFold(*i.CommitMessageContainsFold)) + } + if i.CommitType != nil { + predicates = append(predicates, gitattestation.CommitTypeEQ(*i.CommitType)) + } + if i.CommitTypeNEQ != nil { + predicates = append(predicates, gitattestation.CommitTypeNEQ(*i.CommitTypeNEQ)) + } + if len(i.CommitTypeIn) > 0 { + predicates = append(predicates, gitattestation.CommitTypeIn(i.CommitTypeIn...)) + } + if len(i.CommitTypeNotIn) > 0 { + predicates = append(predicates, gitattestation.CommitTypeNotIn(i.CommitTypeNotIn...)) + } + if i.CommitTypeGT != nil { + predicates = append(predicates, gitattestation.CommitTypeGT(*i.CommitTypeGT)) + } + if i.CommitTypeGTE != nil { + predicates = append(predicates, gitattestation.CommitTypeGTE(*i.CommitTypeGTE)) + } + if i.CommitTypeLT != nil { + predicates = append(predicates, gitattestation.CommitTypeLT(*i.CommitTypeLT)) + } + if i.CommitTypeLTE != nil { + predicates = append(predicates, gitattestation.CommitTypeLTE(*i.CommitTypeLTE)) + } + if i.CommitTypeContains != nil { + predicates = append(predicates, gitattestation.CommitTypeContains(*i.CommitTypeContains)) + } + if i.CommitTypeHasPrefix != nil { + predicates = append(predicates, gitattestation.CommitTypeHasPrefix(*i.CommitTypeHasPrefix)) + } + if i.CommitTypeHasSuffix != nil { + predicates = append(predicates, gitattestation.CommitTypeHasSuffix(*i.CommitTypeHasSuffix)) + } + if i.CommitTypeEqualFold != nil { + predicates = append(predicates, gitattestation.CommitTypeEqualFold(*i.CommitTypeEqualFold)) + } + if i.CommitTypeContainsFold != nil { + predicates = append(predicates, gitattestation.CommitTypeContainsFold(*i.CommitTypeContainsFold)) + } + if i.CommitDigest != nil { + predicates = append(predicates, gitattestation.CommitDigestEQ(*i.CommitDigest)) + } + if i.CommitDigestNEQ != nil { + predicates = append(predicates, gitattestation.CommitDigestNEQ(*i.CommitDigestNEQ)) + } + if len(i.CommitDigestIn) > 0 { + predicates = append(predicates, gitattestation.CommitDigestIn(i.CommitDigestIn...)) + } + if len(i.CommitDigestNotIn) > 0 { + predicates = append(predicates, gitattestation.CommitDigestNotIn(i.CommitDigestNotIn...)) + } + if i.CommitDigestGT != nil { + predicates = append(predicates, gitattestation.CommitDigestGT(*i.CommitDigestGT)) + } + if i.CommitDigestGTE != nil { + predicates = append(predicates, gitattestation.CommitDigestGTE(*i.CommitDigestGTE)) + } + if i.CommitDigestLT != nil { + predicates = append(predicates, gitattestation.CommitDigestLT(*i.CommitDigestLT)) + } + if i.CommitDigestLTE != nil { + predicates = append(predicates, gitattestation.CommitDigestLTE(*i.CommitDigestLTE)) + } + if i.CommitDigestContains != nil { + predicates = append(predicates, gitattestation.CommitDigestContains(*i.CommitDigestContains)) + } + if i.CommitDigestHasPrefix != nil { + predicates = append(predicates, gitattestation.CommitDigestHasPrefix(*i.CommitDigestHasPrefix)) + } + if i.CommitDigestHasSuffix != nil { + predicates = append(predicates, gitattestation.CommitDigestHasSuffix(*i.CommitDigestHasSuffix)) + } + if i.CommitDigestEqualFold != nil { + predicates = append(predicates, gitattestation.CommitDigestEqualFold(*i.CommitDigestEqualFold)) + } + if i.CommitDigestContainsFold != nil { + predicates = append(predicates, gitattestation.CommitDigestContainsFold(*i.CommitDigestContainsFold)) + } + if i.Signature != nil { + predicates = append(predicates, gitattestation.SignatureEQ(*i.Signature)) + } + if i.SignatureNEQ != nil { + predicates = append(predicates, gitattestation.SignatureNEQ(*i.SignatureNEQ)) + } + if len(i.SignatureIn) > 0 { + predicates = append(predicates, gitattestation.SignatureIn(i.SignatureIn...)) + } + if len(i.SignatureNotIn) > 0 { + predicates = append(predicates, gitattestation.SignatureNotIn(i.SignatureNotIn...)) + } + if i.SignatureGT != nil { + predicates = append(predicates, gitattestation.SignatureGT(*i.SignatureGT)) + } + if i.SignatureGTE != nil { + predicates = append(predicates, gitattestation.SignatureGTE(*i.SignatureGTE)) + } + if i.SignatureLT != nil { + predicates = append(predicates, gitattestation.SignatureLT(*i.SignatureLT)) + } + if i.SignatureLTE != nil { + predicates = append(predicates, gitattestation.SignatureLTE(*i.SignatureLTE)) + } + if i.SignatureContains != nil { + predicates = append(predicates, gitattestation.SignatureContains(*i.SignatureContains)) + } + if i.SignatureHasPrefix != nil { + predicates = append(predicates, gitattestation.SignatureHasPrefix(*i.SignatureHasPrefix)) + } + if i.SignatureHasSuffix != nil { + predicates = append(predicates, gitattestation.SignatureHasSuffix(*i.SignatureHasSuffix)) + } + if i.SignatureEqualFold != nil { + predicates = append(predicates, gitattestation.SignatureEqualFold(*i.SignatureEqualFold)) + } + if i.SignatureContainsFold != nil { + predicates = append(predicates, gitattestation.SignatureContainsFold(*i.SignatureContainsFold)) + } + if i.TreeHash != nil { + predicates = append(predicates, gitattestation.TreeHashEQ(*i.TreeHash)) + } + if i.TreeHashNEQ != nil { + predicates = append(predicates, gitattestation.TreeHashNEQ(*i.TreeHashNEQ)) + } + if len(i.TreeHashIn) > 0 { + predicates = append(predicates, gitattestation.TreeHashIn(i.TreeHashIn...)) + } + if len(i.TreeHashNotIn) > 0 { + predicates = append(predicates, gitattestation.TreeHashNotIn(i.TreeHashNotIn...)) + } + if i.TreeHashGT != nil { + predicates = append(predicates, gitattestation.TreeHashGT(*i.TreeHashGT)) + } + if i.TreeHashGTE != nil { + predicates = append(predicates, gitattestation.TreeHashGTE(*i.TreeHashGTE)) + } + if i.TreeHashLT != nil { + predicates = append(predicates, gitattestation.TreeHashLT(*i.TreeHashLT)) + } + if i.TreeHashLTE != nil { + predicates = append(predicates, gitattestation.TreeHashLTE(*i.TreeHashLTE)) + } + if i.TreeHashContains != nil { + predicates = append(predicates, gitattestation.TreeHashContains(*i.TreeHashContains)) + } + if i.TreeHashHasPrefix != nil { + predicates = append(predicates, gitattestation.TreeHashHasPrefix(*i.TreeHashHasPrefix)) + } + if i.TreeHashHasSuffix != nil { + predicates = append(predicates, gitattestation.TreeHashHasSuffix(*i.TreeHashHasSuffix)) + } + if i.TreeHashEqualFold != nil { + predicates = append(predicates, gitattestation.TreeHashEqualFold(*i.TreeHashEqualFold)) + } + if i.TreeHashContainsFold != nil { + predicates = append(predicates, gitattestation.TreeHashContainsFold(*i.TreeHashContainsFold)) + } + + if i.HasAttestation != nil { + p := gitattestation.HasAttestation() + if !*i.HasAttestation { + p = gitattestation.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasAttestationWith) > 0 { + with := make([]predicate.Attestation, 0, len(i.HasAttestationWith)) + for _, w := range i.HasAttestationWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasAttestationWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, gitattestation.HasAttestationWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyGitAttestationWhereInput + case 1: + return predicates[0], nil + default: + return gitattestation.And(predicates...), nil + } +} + // PayloadDigestWhereInput represents a where input for filtering PayloadDigest queries. type PayloadDigestWhereInput struct { Predicates []predicate.PayloadDigest `json:"-"` diff --git a/ent/hook/hook.go b/ent/hook/hook.go index a4f9b6f4..0f5eaeeb 100644 --- a/ent/hook/hook.go +++ b/ent/hook/hook.go @@ -57,6 +57,18 @@ func (f DsseFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.DsseMutation", m) } +// The GitAttestationFunc type is an adapter to allow the use of ordinary +// function as GitAttestation mutator. +type GitAttestationFunc func(context.Context, *ent.GitAttestationMutation) (ent.Value, error) + +// Mutate calls f(ctx, m). +func (f GitAttestationFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if mv, ok := m.(*ent.GitAttestationMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.GitAttestationMutation", m) +} + // The PayloadDigestFunc type is an adapter to allow the use of ordinary // function as PayloadDigest mutator. type PayloadDigestFunc func(context.Context, *ent.PayloadDigestMutation) (ent.Value, error) diff --git a/ent/migrate/migrations/mysql/20240613183002_mysql.sql b/ent/migrate/migrations/mysql/20240613183002_mysql.sql new file mode 100644 index 00000000..3ccbec37 --- /dev/null +++ b/ent/migrate/migrations/mysql/20240613183002_mysql.sql @@ -0,0 +1,2 @@ +-- Create "git_attestations" table +CREATE TABLE `git_attestations` (`id` char(36) NOT NULL, `commit_hash` varchar(255) NOT NULL, `author` varchar(255) NOT NULL, `author_email` varchar(255) NOT NULL, `committer_name` varchar(255) NOT NULL, `committer_email` varchar(255) NOT NULL, `commit_date` varchar(255) NOT NULL, `commit_message` varchar(255) NOT NULL, `status` json NOT NULL, `commit_type` varchar(255) NOT NULL, `commit_digest` varchar(255) NOT NULL, `signature` varchar(255) NOT NULL, `parent_hashes` json NOT NULL, `tree_hash` varchar(255) NOT NULL, `refs` json NOT NULL, `remotes` json NOT NULL, `attestation_git_attestation` char(36) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `attestation_git_attestation` (`attestation_git_attestation`), CONSTRAINT `git_attestations_attestations_git_attestation` FOREIGN KEY (`attestation_git_attestation`) REFERENCES `attestations` (`id`) ON UPDATE NO ACTION ON DELETE NO ACTION) CHARSET utf8mb4 COLLATE utf8mb4_bin; diff --git a/ent/migrate/migrations/mysql/atlas.sum b/ent/migrate/migrations/mysql/atlas.sum index 55583c3a..a3b4efde 100644 --- a/ent/migrate/migrations/mysql/atlas.sum +++ b/ent/migrate/migrations/mysql/atlas.sum @@ -1,2 +1,3 @@ -h1:hmfy8z9GJo6qsuCUPic5i8LIZpfIF0Phkud7Woix6c4= +h1:JZ6kYlrZKmfXx04d5DWFhpKo31q+/eS+kjRepJZwyZk= 20240524112613_mysql.sql h1:P16hl/ui8F+xn7opuJT+GCQ8vnJEsQkZp8Q9PMOhrRI= +20240613183002_mysql.sql h1:qcCQkOioJxX+zgEwihoDG6r3il+t8OalnjUAAkXUnKQ= diff --git a/ent/migrate/migrations/pgsql/20240613183004_pgsql.sql b/ent/migrate/migrations/pgsql/20240613183004_pgsql.sql new file mode 100644 index 00000000..d799fc76 --- /dev/null +++ b/ent/migrate/migrations/pgsql/20240613183004_pgsql.sql @@ -0,0 +1,4 @@ +-- Create "git_attestations" table +CREATE TABLE "git_attestations" ("id" uuid NOT NULL, "commit_hash" character varying NOT NULL, "author" character varying NOT NULL, "author_email" character varying NOT NULL, "committer_name" character varying NOT NULL, "committer_email" character varying NOT NULL, "commit_date" character varying NOT NULL, "commit_message" character varying NOT NULL, "status" jsonb NOT NULL, "commit_type" character varying NOT NULL, "commit_digest" character varying NOT NULL, "signature" character varying NOT NULL, "parent_hashes" jsonb NOT NULL, "tree_hash" character varying NOT NULL, "refs" jsonb NOT NULL, "remotes" jsonb NOT NULL, "attestation_git_attestation" uuid NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "git_attestations_attestations_git_attestation" FOREIGN KEY ("attestation_git_attestation") REFERENCES "attestations" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- Create index "git_attestations_attestation_git_attestation_key" to table: "git_attestations" +CREATE UNIQUE INDEX "git_attestations_attestation_git_attestation_key" ON "git_attestations" ("attestation_git_attestation"); diff --git a/ent/migrate/migrations/pgsql/atlas.sum b/ent/migrate/migrations/pgsql/atlas.sum index ef622b12..980912e5 100644 --- a/ent/migrate/migrations/pgsql/atlas.sum +++ b/ent/migrate/migrations/pgsql/atlas.sum @@ -1,2 +1,3 @@ -h1:tRI2n5O6+6fHTOil/e3LGqO1PEcv3D02M3VmEkH00ls= +h1:QmVcAavhlNODmI+X+hxJZA3XNKY4dicwJp3ot/U1ygU= 20240524112615_pgsql.sql h1:HMRY5DPVr3SjgjpdkCY3+3Us5y5LvtSzNEBwoIND5sY= +20240613183004_pgsql.sql h1:SbWh69gk9PeLTM/FluhVIc39bg83bXLVcYzq06e4GL4= diff --git a/ent/migrate/schema.go b/ent/migrate/schema.go index 8d445000..cae1cd4e 100644 --- a/ent/migrate/schema.go +++ b/ent/migrate/schema.go @@ -110,6 +110,40 @@ var ( }, }, } + // GitAttestationsColumns holds the columns for the "git_attestations" table. + GitAttestationsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeUUID, Unique: true}, + {Name: "commit_hash", Type: field.TypeString}, + {Name: "author", Type: field.TypeString}, + {Name: "author_email", Type: field.TypeString}, + {Name: "committer_name", Type: field.TypeString}, + {Name: "committer_email", Type: field.TypeString}, + {Name: "commit_date", Type: field.TypeString}, + {Name: "commit_message", Type: field.TypeString}, + {Name: "status", Type: field.TypeJSON}, + {Name: "commit_type", Type: field.TypeString}, + {Name: "commit_digest", Type: field.TypeString}, + {Name: "signature", Type: field.TypeString}, + {Name: "parent_hashes", Type: field.TypeJSON}, + {Name: "tree_hash", Type: field.TypeString}, + {Name: "refs", Type: field.TypeJSON}, + {Name: "remotes", Type: field.TypeJSON}, + {Name: "attestation_git_attestation", Type: field.TypeUUID, Unique: true}, + } + // GitAttestationsTable holds the schema information for the "git_attestations" table. + GitAttestationsTable = &schema.Table{ + Name: "git_attestations", + Columns: GitAttestationsColumns, + PrimaryKey: []*schema.Column{GitAttestationsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "git_attestations_attestations_git_attestation", + Columns: []*schema.Column{GitAttestationsColumns[16]}, + RefColumns: []*schema.Column{AttestationsColumns[0]}, + OnDelete: schema.NoAction, + }, + }, + } // PayloadDigestsColumns holds the columns for the "payload_digests" table. PayloadDigestsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID, Unique: true}, @@ -266,6 +300,7 @@ var ( AttestationCollectionsTable, AttestationPoliciesTable, DssesTable, + GitAttestationsTable, PayloadDigestsTable, SignaturesTable, StatementsTable, @@ -280,6 +315,7 @@ func init() { AttestationCollectionsTable.ForeignKeys[0].RefTable = StatementsTable AttestationPoliciesTable.ForeignKeys[0].RefTable = StatementsTable DssesTable.ForeignKeys[0].RefTable = StatementsTable + GitAttestationsTable.ForeignKeys[0].RefTable = AttestationsTable PayloadDigestsTable.ForeignKeys[0].RefTable = DssesTable SignaturesTable.ForeignKeys[0].RefTable = DssesTable SubjectsTable.ForeignKeys[0].RefTable = StatementsTable diff --git a/ent/mutation.go b/ent/mutation.go index 634bd35c..84f8b136 100644 --- a/ent/mutation.go +++ b/ent/mutation.go @@ -16,6 +16,7 @@ import ( "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/gitattestation" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/predicate" "github.com/in-toto/archivista/ent/signature" @@ -38,6 +39,7 @@ const ( TypeAttestationCollection = "AttestationCollection" TypeAttestationPolicy = "AttestationPolicy" TypeDsse = "Dsse" + TypeGitAttestation = "GitAttestation" TypePayloadDigest = "PayloadDigest" TypeSignature = "Signature" TypeStatement = "Statement" @@ -56,6 +58,8 @@ type AttestationMutation struct { clearedFields map[string]struct{} attestation_collection *uuid.UUID clearedattestation_collection bool + git_attestation *uuid.UUID + clearedgit_attestation bool done bool oldValue func(context.Context) (*Attestation, error) predicates []predicate.Attestation @@ -240,6 +244,45 @@ func (m *AttestationMutation) ResetAttestationCollection() { m.clearedattestation_collection = false } +// SetGitAttestationID sets the "git_attestation" edge to the GitAttestation entity by id. +func (m *AttestationMutation) SetGitAttestationID(id uuid.UUID) { + m.git_attestation = &id +} + +// ClearGitAttestation clears the "git_attestation" edge to the GitAttestation entity. +func (m *AttestationMutation) ClearGitAttestation() { + m.clearedgit_attestation = true +} + +// GitAttestationCleared reports if the "git_attestation" edge to the GitAttestation entity was cleared. +func (m *AttestationMutation) GitAttestationCleared() bool { + return m.clearedgit_attestation +} + +// GitAttestationID returns the "git_attestation" edge ID in the mutation. +func (m *AttestationMutation) GitAttestationID() (id uuid.UUID, exists bool) { + if m.git_attestation != nil { + return *m.git_attestation, true + } + return +} + +// GitAttestationIDs returns the "git_attestation" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// GitAttestationID instead. It exists only for internal usage by the builders. +func (m *AttestationMutation) GitAttestationIDs() (ids []uuid.UUID) { + if id := m.git_attestation; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetGitAttestation resets all changes to the "git_attestation" edge. +func (m *AttestationMutation) ResetGitAttestation() { + m.git_attestation = nil + m.clearedgit_attestation = false +} + // Where appends a list predicates to the AttestationMutation builder. func (m *AttestationMutation) Where(ps ...predicate.Attestation) { m.predicates = append(m.predicates, ps...) @@ -373,10 +416,13 @@ func (m *AttestationMutation) ResetField(name string) error { // AddedEdges returns all edge names that were set/added in this mutation. func (m *AttestationMutation) AddedEdges() []string { - edges := make([]string, 0, 1) + edges := make([]string, 0, 2) if m.attestation_collection != nil { edges = append(edges, attestation.EdgeAttestationCollection) } + if m.git_attestation != nil { + edges = append(edges, attestation.EdgeGitAttestation) + } return edges } @@ -388,13 +434,17 @@ func (m *AttestationMutation) AddedIDs(name string) []ent.Value { if id := m.attestation_collection; id != nil { return []ent.Value{*id} } + case attestation.EdgeGitAttestation: + if id := m.git_attestation; id != nil { + return []ent.Value{*id} + } } return nil } // RemovedEdges returns all edge names that were removed in this mutation. func (m *AttestationMutation) RemovedEdges() []string { - edges := make([]string, 0, 1) + edges := make([]string, 0, 2) return edges } @@ -406,10 +456,13 @@ func (m *AttestationMutation) RemovedIDs(name string) []ent.Value { // ClearedEdges returns all edge names that were cleared in this mutation. func (m *AttestationMutation) ClearedEdges() []string { - edges := make([]string, 0, 1) + edges := make([]string, 0, 2) if m.clearedattestation_collection { edges = append(edges, attestation.EdgeAttestationCollection) } + if m.clearedgit_attestation { + edges = append(edges, attestation.EdgeGitAttestation) + } return edges } @@ -419,6 +472,8 @@ func (m *AttestationMutation) EdgeCleared(name string) bool { switch name { case attestation.EdgeAttestationCollection: return m.clearedattestation_collection + case attestation.EdgeGitAttestation: + return m.clearedgit_attestation } return false } @@ -430,6 +485,9 @@ func (m *AttestationMutation) ClearEdge(name string) error { case attestation.EdgeAttestationCollection: m.ClearAttestationCollection() return nil + case attestation.EdgeGitAttestation: + m.ClearGitAttestation() + return nil } return fmt.Errorf("unknown Attestation unique edge %s", name) } @@ -441,6 +499,9 @@ func (m *AttestationMutation) ResetEdge(name string) error { case attestation.EdgeAttestationCollection: m.ResetAttestationCollection() return nil + case attestation.EdgeGitAttestation: + m.ResetGitAttestation() + return nil } return fmt.Errorf("unknown Attestation edge %s", name) } @@ -1949,6 +2010,1225 @@ func (m *DsseMutation) ResetEdge(name string) error { return fmt.Errorf("unknown Dsse edge %s", name) } +// GitAttestationMutation represents an operation that mutates the GitAttestation nodes in the graph. +type GitAttestationMutation struct { + config + op Op + typ string + id *uuid.UUID + commit_hash *string + author *string + author_email *string + committer_name *string + committer_email *string + commit_date *string + commit_message *string + status *[]string + appendstatus []string + commit_type *string + commit_digest *string + signature *string + parent_hashes *[]string + appendparent_hashes []string + tree_hash *string + refs *[]string + appendrefs []string + remotes *[]string + appendremotes []string + clearedFields map[string]struct{} + attestation *uuid.UUID + clearedattestation bool + done bool + oldValue func(context.Context) (*GitAttestation, error) + predicates []predicate.GitAttestation +} + +var _ ent.Mutation = (*GitAttestationMutation)(nil) + +// gitattestationOption allows management of the mutation configuration using functional options. +type gitattestationOption func(*GitAttestationMutation) + +// newGitAttestationMutation creates new mutation for the GitAttestation entity. +func newGitAttestationMutation(c config, op Op, opts ...gitattestationOption) *GitAttestationMutation { + m := &GitAttestationMutation{ + config: c, + op: op, + typ: TypeGitAttestation, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withGitAttestationID sets the ID field of the mutation. +func withGitAttestationID(id uuid.UUID) gitattestationOption { + return func(m *GitAttestationMutation) { + var ( + err error + once sync.Once + value *GitAttestation + ) + m.oldValue = func(ctx context.Context) (*GitAttestation, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().GitAttestation.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGitAttestation sets the old GitAttestation of the mutation. +func withGitAttestation(node *GitAttestation) gitattestationOption { + return func(m *GitAttestationMutation) { + m.oldValue = func(context.Context) (*GitAttestation, 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 GitAttestationMutation) 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 GitAttestationMutation) 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 +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of GitAttestation entities. +func (m *GitAttestationMutation) SetID(id uuid.UUID) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *GitAttestationMutation) ID() (id uuid.UUID, 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 *GitAttestationMutation) IDs(ctx context.Context) ([]uuid.UUID, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []uuid.UUID{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().GitAttestation.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCommitHash sets the "commit_hash" field. +func (m *GitAttestationMutation) SetCommitHash(s string) { + m.commit_hash = &s +} + +// CommitHash returns the value of the "commit_hash" field in the mutation. +func (m *GitAttestationMutation) CommitHash() (r string, exists bool) { + v := m.commit_hash + if v == nil { + return + } + return *v, true +} + +// OldCommitHash returns the old "commit_hash" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldCommitHash(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCommitHash is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCommitHash requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCommitHash: %w", err) + } + return oldValue.CommitHash, nil +} + +// ResetCommitHash resets all changes to the "commit_hash" field. +func (m *GitAttestationMutation) ResetCommitHash() { + m.commit_hash = nil +} + +// SetAuthor sets the "author" field. +func (m *GitAttestationMutation) SetAuthor(s string) { + m.author = &s +} + +// Author returns the value of the "author" field in the mutation. +func (m *GitAttestationMutation) Author() (r string, exists bool) { + v := m.author + if v == nil { + return + } + return *v, true +} + +// OldAuthor returns the old "author" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldAuthor(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAuthor is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAuthor requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAuthor: %w", err) + } + return oldValue.Author, nil +} + +// ResetAuthor resets all changes to the "author" field. +func (m *GitAttestationMutation) ResetAuthor() { + m.author = nil +} + +// SetAuthorEmail sets the "author_email" field. +func (m *GitAttestationMutation) SetAuthorEmail(s string) { + m.author_email = &s +} + +// AuthorEmail returns the value of the "author_email" field in the mutation. +func (m *GitAttestationMutation) AuthorEmail() (r string, exists bool) { + v := m.author_email + if v == nil { + return + } + return *v, true +} + +// OldAuthorEmail returns the old "author_email" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldAuthorEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAuthorEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAuthorEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAuthorEmail: %w", err) + } + return oldValue.AuthorEmail, nil +} + +// ResetAuthorEmail resets all changes to the "author_email" field. +func (m *GitAttestationMutation) ResetAuthorEmail() { + m.author_email = nil +} + +// SetCommitterName sets the "committer_name" field. +func (m *GitAttestationMutation) SetCommitterName(s string) { + m.committer_name = &s +} + +// CommitterName returns the value of the "committer_name" field in the mutation. +func (m *GitAttestationMutation) CommitterName() (r string, exists bool) { + v := m.committer_name + if v == nil { + return + } + return *v, true +} + +// OldCommitterName returns the old "committer_name" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldCommitterName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCommitterName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCommitterName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCommitterName: %w", err) + } + return oldValue.CommitterName, nil +} + +// ResetCommitterName resets all changes to the "committer_name" field. +func (m *GitAttestationMutation) ResetCommitterName() { + m.committer_name = nil +} + +// SetCommitterEmail sets the "committer_email" field. +func (m *GitAttestationMutation) SetCommitterEmail(s string) { + m.committer_email = &s +} + +// CommitterEmail returns the value of the "committer_email" field in the mutation. +func (m *GitAttestationMutation) CommitterEmail() (r string, exists bool) { + v := m.committer_email + if v == nil { + return + } + return *v, true +} + +// OldCommitterEmail returns the old "committer_email" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldCommitterEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCommitterEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCommitterEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCommitterEmail: %w", err) + } + return oldValue.CommitterEmail, nil +} + +// ResetCommitterEmail resets all changes to the "committer_email" field. +func (m *GitAttestationMutation) ResetCommitterEmail() { + m.committer_email = nil +} + +// SetCommitDate sets the "commit_date" field. +func (m *GitAttestationMutation) SetCommitDate(s string) { + m.commit_date = &s +} + +// CommitDate returns the value of the "commit_date" field in the mutation. +func (m *GitAttestationMutation) CommitDate() (r string, exists bool) { + v := m.commit_date + if v == nil { + return + } + return *v, true +} + +// OldCommitDate returns the old "commit_date" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldCommitDate(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCommitDate is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCommitDate requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCommitDate: %w", err) + } + return oldValue.CommitDate, nil +} + +// ResetCommitDate resets all changes to the "commit_date" field. +func (m *GitAttestationMutation) ResetCommitDate() { + m.commit_date = nil +} + +// SetCommitMessage sets the "commit_message" field. +func (m *GitAttestationMutation) SetCommitMessage(s string) { + m.commit_message = &s +} + +// CommitMessage returns the value of the "commit_message" field in the mutation. +func (m *GitAttestationMutation) CommitMessage() (r string, exists bool) { + v := m.commit_message + if v == nil { + return + } + return *v, true +} + +// OldCommitMessage returns the old "commit_message" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldCommitMessage(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCommitMessage is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCommitMessage requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCommitMessage: %w", err) + } + return oldValue.CommitMessage, nil +} + +// ResetCommitMessage resets all changes to the "commit_message" field. +func (m *GitAttestationMutation) ResetCommitMessage() { + m.commit_message = nil +} + +// SetStatus sets the "status" field. +func (m *GitAttestationMutation) SetStatus(s []string) { + m.status = &s + m.appendstatus = nil +} + +// Status returns the value of the "status" field in the mutation. +func (m *GitAttestationMutation) Status() (r []string, exists bool) { + v := m.status + if v == nil { + return + } + return *v, true +} + +// OldStatus returns the old "status" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldStatus(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldStatus is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldStatus requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStatus: %w", err) + } + return oldValue.Status, nil +} + +// AppendStatus adds s to the "status" field. +func (m *GitAttestationMutation) AppendStatus(s []string) { + m.appendstatus = append(m.appendstatus, s...) +} + +// AppendedStatus returns the list of values that were appended to the "status" field in this mutation. +func (m *GitAttestationMutation) AppendedStatus() ([]string, bool) { + if len(m.appendstatus) == 0 { + return nil, false + } + return m.appendstatus, true +} + +// ResetStatus resets all changes to the "status" field. +func (m *GitAttestationMutation) ResetStatus() { + m.status = nil + m.appendstatus = nil +} + +// SetCommitType sets the "commit_type" field. +func (m *GitAttestationMutation) SetCommitType(s string) { + m.commit_type = &s +} + +// CommitType returns the value of the "commit_type" field in the mutation. +func (m *GitAttestationMutation) CommitType() (r string, exists bool) { + v := m.commit_type + if v == nil { + return + } + return *v, true +} + +// OldCommitType returns the old "commit_type" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldCommitType(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCommitType is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCommitType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCommitType: %w", err) + } + return oldValue.CommitType, nil +} + +// ResetCommitType resets all changes to the "commit_type" field. +func (m *GitAttestationMutation) ResetCommitType() { + m.commit_type = nil +} + +// SetCommitDigest sets the "commit_digest" field. +func (m *GitAttestationMutation) SetCommitDigest(s string) { + m.commit_digest = &s +} + +// CommitDigest returns the value of the "commit_digest" field in the mutation. +func (m *GitAttestationMutation) CommitDigest() (r string, exists bool) { + v := m.commit_digest + if v == nil { + return + } + return *v, true +} + +// OldCommitDigest returns the old "commit_digest" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldCommitDigest(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCommitDigest is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCommitDigest requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCommitDigest: %w", err) + } + return oldValue.CommitDigest, nil +} + +// ResetCommitDigest resets all changes to the "commit_digest" field. +func (m *GitAttestationMutation) ResetCommitDigest() { + m.commit_digest = nil +} + +// SetSignature sets the "signature" field. +func (m *GitAttestationMutation) SetSignature(s string) { + m.signature = &s +} + +// Signature returns the value of the "signature" field in the mutation. +func (m *GitAttestationMutation) Signature() (r string, exists bool) { + v := m.signature + if v == nil { + return + } + return *v, true +} + +// OldSignature returns the old "signature" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldSignature(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSignature is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSignature requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSignature: %w", err) + } + return oldValue.Signature, nil +} + +// ResetSignature resets all changes to the "signature" field. +func (m *GitAttestationMutation) ResetSignature() { + m.signature = nil +} + +// SetParentHashes sets the "parent_hashes" field. +func (m *GitAttestationMutation) SetParentHashes(s []string) { + m.parent_hashes = &s + m.appendparent_hashes = nil +} + +// ParentHashes returns the value of the "parent_hashes" field in the mutation. +func (m *GitAttestationMutation) ParentHashes() (r []string, exists bool) { + v := m.parent_hashes + if v == nil { + return + } + return *v, true +} + +// OldParentHashes returns the old "parent_hashes" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldParentHashes(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldParentHashes is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldParentHashes requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldParentHashes: %w", err) + } + return oldValue.ParentHashes, nil +} + +// AppendParentHashes adds s to the "parent_hashes" field. +func (m *GitAttestationMutation) AppendParentHashes(s []string) { + m.appendparent_hashes = append(m.appendparent_hashes, s...) +} + +// AppendedParentHashes returns the list of values that were appended to the "parent_hashes" field in this mutation. +func (m *GitAttestationMutation) AppendedParentHashes() ([]string, bool) { + if len(m.appendparent_hashes) == 0 { + return nil, false + } + return m.appendparent_hashes, true +} + +// ResetParentHashes resets all changes to the "parent_hashes" field. +func (m *GitAttestationMutation) ResetParentHashes() { + m.parent_hashes = nil + m.appendparent_hashes = nil +} + +// SetTreeHash sets the "tree_hash" field. +func (m *GitAttestationMutation) SetTreeHash(s string) { + m.tree_hash = &s +} + +// TreeHash returns the value of the "tree_hash" field in the mutation. +func (m *GitAttestationMutation) TreeHash() (r string, exists bool) { + v := m.tree_hash + if v == nil { + return + } + return *v, true +} + +// OldTreeHash returns the old "tree_hash" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldTreeHash(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTreeHash is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTreeHash requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTreeHash: %w", err) + } + return oldValue.TreeHash, nil +} + +// ResetTreeHash resets all changes to the "tree_hash" field. +func (m *GitAttestationMutation) ResetTreeHash() { + m.tree_hash = nil +} + +// SetRefs sets the "refs" field. +func (m *GitAttestationMutation) SetRefs(s []string) { + m.refs = &s + m.appendrefs = nil +} + +// Refs returns the value of the "refs" field in the mutation. +func (m *GitAttestationMutation) Refs() (r []string, exists bool) { + v := m.refs + if v == nil { + return + } + return *v, true +} + +// OldRefs returns the old "refs" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldRefs(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRefs is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRefs requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRefs: %w", err) + } + return oldValue.Refs, nil +} + +// AppendRefs adds s to the "refs" field. +func (m *GitAttestationMutation) AppendRefs(s []string) { + m.appendrefs = append(m.appendrefs, s...) +} + +// AppendedRefs returns the list of values that were appended to the "refs" field in this mutation. +func (m *GitAttestationMutation) AppendedRefs() ([]string, bool) { + if len(m.appendrefs) == 0 { + return nil, false + } + return m.appendrefs, true +} + +// ResetRefs resets all changes to the "refs" field. +func (m *GitAttestationMutation) ResetRefs() { + m.refs = nil + m.appendrefs = nil +} + +// SetRemotes sets the "remotes" field. +func (m *GitAttestationMutation) SetRemotes(s []string) { + m.remotes = &s + m.appendremotes = nil +} + +// Remotes returns the value of the "remotes" field in the mutation. +func (m *GitAttestationMutation) Remotes() (r []string, exists bool) { + v := m.remotes + if v == nil { + return + } + return *v, true +} + +// OldRemotes returns the old "remotes" field's value of the GitAttestation entity. +// If the GitAttestation 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 *GitAttestationMutation) OldRemotes(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRemotes is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRemotes requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRemotes: %w", err) + } + return oldValue.Remotes, nil +} + +// AppendRemotes adds s to the "remotes" field. +func (m *GitAttestationMutation) AppendRemotes(s []string) { + m.appendremotes = append(m.appendremotes, s...) +} + +// AppendedRemotes returns the list of values that were appended to the "remotes" field in this mutation. +func (m *GitAttestationMutation) AppendedRemotes() ([]string, bool) { + if len(m.appendremotes) == 0 { + return nil, false + } + return m.appendremotes, true +} + +// ResetRemotes resets all changes to the "remotes" field. +func (m *GitAttestationMutation) ResetRemotes() { + m.remotes = nil + m.appendremotes = nil +} + +// SetAttestationID sets the "attestation" edge to the Attestation entity by id. +func (m *GitAttestationMutation) SetAttestationID(id uuid.UUID) { + m.attestation = &id +} + +// ClearAttestation clears the "attestation" edge to the Attestation entity. +func (m *GitAttestationMutation) ClearAttestation() { + m.clearedattestation = true +} + +// AttestationCleared reports if the "attestation" edge to the Attestation entity was cleared. +func (m *GitAttestationMutation) AttestationCleared() bool { + return m.clearedattestation +} + +// AttestationID returns the "attestation" edge ID in the mutation. +func (m *GitAttestationMutation) AttestationID() (id uuid.UUID, exists bool) { + if m.attestation != nil { + return *m.attestation, true + } + return +} + +// AttestationIDs returns the "attestation" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// AttestationID instead. It exists only for internal usage by the builders. +func (m *GitAttestationMutation) AttestationIDs() (ids []uuid.UUID) { + if id := m.attestation; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetAttestation resets all changes to the "attestation" edge. +func (m *GitAttestationMutation) ResetAttestation() { + m.attestation = nil + m.clearedattestation = false +} + +// Where appends a list predicates to the GitAttestationMutation builder. +func (m *GitAttestationMutation) Where(ps ...predicate.GitAttestation) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the GitAttestationMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *GitAttestationMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.GitAttestation, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *GitAttestationMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *GitAttestationMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (GitAttestation). +func (m *GitAttestationMutation) 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 *GitAttestationMutation) Fields() []string { + fields := make([]string, 0, 15) + if m.commit_hash != nil { + fields = append(fields, gitattestation.FieldCommitHash) + } + if m.author != nil { + fields = append(fields, gitattestation.FieldAuthor) + } + if m.author_email != nil { + fields = append(fields, gitattestation.FieldAuthorEmail) + } + if m.committer_name != nil { + fields = append(fields, gitattestation.FieldCommitterName) + } + if m.committer_email != nil { + fields = append(fields, gitattestation.FieldCommitterEmail) + } + if m.commit_date != nil { + fields = append(fields, gitattestation.FieldCommitDate) + } + if m.commit_message != nil { + fields = append(fields, gitattestation.FieldCommitMessage) + } + if m.status != nil { + fields = append(fields, gitattestation.FieldStatus) + } + if m.commit_type != nil { + fields = append(fields, gitattestation.FieldCommitType) + } + if m.commit_digest != nil { + fields = append(fields, gitattestation.FieldCommitDigest) + } + if m.signature != nil { + fields = append(fields, gitattestation.FieldSignature) + } + if m.parent_hashes != nil { + fields = append(fields, gitattestation.FieldParentHashes) + } + if m.tree_hash != nil { + fields = append(fields, gitattestation.FieldTreeHash) + } + if m.refs != nil { + fields = append(fields, gitattestation.FieldRefs) + } + if m.remotes != nil { + fields = append(fields, gitattestation.FieldRemotes) + } + 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 *GitAttestationMutation) Field(name string) (ent.Value, bool) { + switch name { + case gitattestation.FieldCommitHash: + return m.CommitHash() + case gitattestation.FieldAuthor: + return m.Author() + case gitattestation.FieldAuthorEmail: + return m.AuthorEmail() + case gitattestation.FieldCommitterName: + return m.CommitterName() + case gitattestation.FieldCommitterEmail: + return m.CommitterEmail() + case gitattestation.FieldCommitDate: + return m.CommitDate() + case gitattestation.FieldCommitMessage: + return m.CommitMessage() + case gitattestation.FieldStatus: + return m.Status() + case gitattestation.FieldCommitType: + return m.CommitType() + case gitattestation.FieldCommitDigest: + return m.CommitDigest() + case gitattestation.FieldSignature: + return m.Signature() + case gitattestation.FieldParentHashes: + return m.ParentHashes() + case gitattestation.FieldTreeHash: + return m.TreeHash() + case gitattestation.FieldRefs: + return m.Refs() + case gitattestation.FieldRemotes: + return m.Remotes() + } + 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 *GitAttestationMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case gitattestation.FieldCommitHash: + return m.OldCommitHash(ctx) + case gitattestation.FieldAuthor: + return m.OldAuthor(ctx) + case gitattestation.FieldAuthorEmail: + return m.OldAuthorEmail(ctx) + case gitattestation.FieldCommitterName: + return m.OldCommitterName(ctx) + case gitattestation.FieldCommitterEmail: + return m.OldCommitterEmail(ctx) + case gitattestation.FieldCommitDate: + return m.OldCommitDate(ctx) + case gitattestation.FieldCommitMessage: + return m.OldCommitMessage(ctx) + case gitattestation.FieldStatus: + return m.OldStatus(ctx) + case gitattestation.FieldCommitType: + return m.OldCommitType(ctx) + case gitattestation.FieldCommitDigest: + return m.OldCommitDigest(ctx) + case gitattestation.FieldSignature: + return m.OldSignature(ctx) + case gitattestation.FieldParentHashes: + return m.OldParentHashes(ctx) + case gitattestation.FieldTreeHash: + return m.OldTreeHash(ctx) + case gitattestation.FieldRefs: + return m.OldRefs(ctx) + case gitattestation.FieldRemotes: + return m.OldRemotes(ctx) + } + return nil, fmt.Errorf("unknown GitAttestation 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 *GitAttestationMutation) SetField(name string, value ent.Value) error { + switch name { + case gitattestation.FieldCommitHash: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCommitHash(v) + return nil + case gitattestation.FieldAuthor: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAuthor(v) + return nil + case gitattestation.FieldAuthorEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAuthorEmail(v) + return nil + case gitattestation.FieldCommitterName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCommitterName(v) + return nil + case gitattestation.FieldCommitterEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCommitterEmail(v) + return nil + case gitattestation.FieldCommitDate: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCommitDate(v) + return nil + case gitattestation.FieldCommitMessage: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCommitMessage(v) + return nil + case gitattestation.FieldStatus: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + case gitattestation.FieldCommitType: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCommitType(v) + return nil + case gitattestation.FieldCommitDigest: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCommitDigest(v) + return nil + case gitattestation.FieldSignature: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSignature(v) + return nil + case gitattestation.FieldParentHashes: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetParentHashes(v) + return nil + case gitattestation.FieldTreeHash: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTreeHash(v) + return nil + case gitattestation.FieldRefs: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRefs(v) + return nil + case gitattestation.FieldRemotes: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRemotes(v) + return nil + } + return fmt.Errorf("unknown GitAttestation field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *GitAttestationMutation) 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 *GitAttestationMutation) 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 *GitAttestationMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown GitAttestation numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *GitAttestationMutation) ClearedFields() []string { + return nil +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *GitAttestationMutation) 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 *GitAttestationMutation) ClearField(name string) error { + return fmt.Errorf("unknown GitAttestation 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 *GitAttestationMutation) ResetField(name string) error { + switch name { + case gitattestation.FieldCommitHash: + m.ResetCommitHash() + return nil + case gitattestation.FieldAuthor: + m.ResetAuthor() + return nil + case gitattestation.FieldAuthorEmail: + m.ResetAuthorEmail() + return nil + case gitattestation.FieldCommitterName: + m.ResetCommitterName() + return nil + case gitattestation.FieldCommitterEmail: + m.ResetCommitterEmail() + return nil + case gitattestation.FieldCommitDate: + m.ResetCommitDate() + return nil + case gitattestation.FieldCommitMessage: + m.ResetCommitMessage() + return nil + case gitattestation.FieldStatus: + m.ResetStatus() + return nil + case gitattestation.FieldCommitType: + m.ResetCommitType() + return nil + case gitattestation.FieldCommitDigest: + m.ResetCommitDigest() + return nil + case gitattestation.FieldSignature: + m.ResetSignature() + return nil + case gitattestation.FieldParentHashes: + m.ResetParentHashes() + return nil + case gitattestation.FieldTreeHash: + m.ResetTreeHash() + return nil + case gitattestation.FieldRefs: + m.ResetRefs() + return nil + case gitattestation.FieldRemotes: + m.ResetRemotes() + return nil + } + return fmt.Errorf("unknown GitAttestation field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *GitAttestationMutation) AddedEdges() []string { + edges := make([]string, 0, 1) + if m.attestation != nil { + edges = append(edges, gitattestation.EdgeAttestation) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *GitAttestationMutation) AddedIDs(name string) []ent.Value { + switch name { + case gitattestation.EdgeAttestation: + if id := m.attestation; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *GitAttestationMutation) 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 *GitAttestationMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *GitAttestationMutation) ClearedEdges() []string { + edges := make([]string, 0, 1) + if m.clearedattestation { + edges = append(edges, gitattestation.EdgeAttestation) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *GitAttestationMutation) EdgeCleared(name string) bool { + switch name { + case gitattestation.EdgeAttestation: + return m.clearedattestation + } + 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 *GitAttestationMutation) ClearEdge(name string) error { + switch name { + case gitattestation.EdgeAttestation: + m.ClearAttestation() + return nil + } + return fmt.Errorf("unknown GitAttestation 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 *GitAttestationMutation) ResetEdge(name string) error { + switch name { + case gitattestation.EdgeAttestation: + m.ResetAttestation() + return nil + } + return fmt.Errorf("unknown GitAttestation edge %s", name) +} + // PayloadDigestMutation represents an operation that mutates the PayloadDigest nodes in the graph. type PayloadDigestMutation struct { config diff --git a/ent/predicate/predicate.go b/ent/predicate/predicate.go index 3306c827..52a104ce 100644 --- a/ent/predicate/predicate.go +++ b/ent/predicate/predicate.go @@ -18,6 +18,9 @@ type AttestationPolicy func(*sql.Selector) // Dsse is the predicate function for dsse builders. type Dsse func(*sql.Selector) +// GitAttestation is the predicate function for gitattestation builders. +type GitAttestation func(*sql.Selector) + // PayloadDigest is the predicate function for payloaddigest builders. type PayloadDigest func(*sql.Selector) diff --git a/ent/runtime.go b/ent/runtime.go index b8a55dcd..1245f80f 100644 --- a/ent/runtime.go +++ b/ent/runtime.go @@ -8,6 +8,7 @@ import ( "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/gitattestation" "github.com/in-toto/archivista/ent/payloaddigest" "github.com/in-toto/archivista/ent/schema" "github.com/in-toto/archivista/ent/signature" @@ -65,6 +66,12 @@ func init() { dsseDescID := dsseFields[0].Descriptor() // dsse.DefaultID holds the default value on creation for the id field. dsse.DefaultID = dsseDescID.Default.(func() uuid.UUID) + gitattestationFields := schema.GitAttestation{}.Fields() + _ = gitattestationFields + // gitattestationDescID is the schema descriptor for id field. + gitattestationDescID := gitattestationFields[0].Descriptor() + // gitattestation.DefaultID holds the default value on creation for the id field. + gitattestation.DefaultID = gitattestationDescID.Default.(func() uuid.UUID) payloaddigestFields := schema.PayloadDigest{}.Fields() _ = payloaddigestFields // payloaddigestDescAlgorithm is the schema descriptor for algorithm field. diff --git a/ent/schema/attestation.go b/ent/schema/attestation.go index 285c9896..2c6a505b 100644 --- a/ent/schema/attestation.go +++ b/ent/schema/attestation.go @@ -37,6 +37,8 @@ func (Attestation) Fields() []ent.Field { func (Attestation) Edges() []ent.Edge { return []ent.Edge{ edge.From("attestation_collection", AttestationCollection.Type).Ref("attestations").Unique().Required(), + + edge.To("git_attestation", GitAttestation.Type).Unique(), } } diff --git a/ent/schema/git_attestation.go b/ent/schema/git_attestation.go new file mode 100644 index 00000000..3929e873 --- /dev/null +++ b/ent/schema/git_attestation.go @@ -0,0 +1,59 @@ +// Copyright 2022 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/ent" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "github.com/google/uuid" +) + +// GitAttestation represents an attestation from a witness attestation collection +type GitAttestation struct { + ent.Schema +} + +func (GitAttestation) Fields() []ent.Field { + return []ent.Field{ + field.UUID("id", uuid.UUID{}).Default(uuid.New).Immutable().Unique(), + field.String("commit_hash"), + field.String("author"), + field.String("author_email"), + field.String("committer_name"), + field.String("committer_email"), + field.String("commit_date"), + field.String("commit_message"), + field.JSON("status", []string{}), + field.String("commit_type"), + field.String("commit_digest"), + field.String("signature"), + field.JSON("parent_hashes", []string{}), + field.String("tree_hash"), + field.JSON("refs", []string{}), + field.JSON("remotes", []string{}), + //field.JSON("tags", []git.Tag{}), // TODO: Add support for gql marshal/unmarshal then revisit this. + } +} + +func (GitAttestation) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("attestation", Attestation.Type).Ref("git_attestation").Unique().Required(), + } +} + +func (GitAttestation) Indexes() []ent.Index { + return []ent.Index{} +} diff --git a/ent/tx.go b/ent/tx.go index 8a1f4cd8..9fc1754a 100644 --- a/ent/tx.go +++ b/ent/tx.go @@ -20,6 +20,8 @@ type Tx struct { AttestationPolicy *AttestationPolicyClient // Dsse is the client for interacting with the Dsse builders. Dsse *DsseClient + // GitAttestation is the client for interacting with the GitAttestation builders. + GitAttestation *GitAttestationClient // PayloadDigest is the client for interacting with the PayloadDigest builders. PayloadDigest *PayloadDigestClient // Signature is the client for interacting with the Signature builders. @@ -167,6 +169,7 @@ func (tx *Tx) init() { tx.AttestationCollection = NewAttestationCollectionClient(tx.config) tx.AttestationPolicy = NewAttestationPolicyClient(tx.config) tx.Dsse = NewDsseClient(tx.config) + tx.GitAttestation = NewGitAttestationClient(tx.config) tx.PayloadDigest = NewPayloadDigestClient(tx.config) tx.Signature = NewSignatureClient(tx.config) tx.Statement = NewStatementClient(tx.config) diff --git a/generated.go b/generated.go index a8502fd6..bb0a7eea 100644 --- a/generated.go +++ b/generated.go @@ -52,6 +52,7 @@ type DirectiveRoot struct { type ComplexityRoot struct { Attestation struct { AttestationCollection func(childComplexity int) int + GitAttestation func(childComplexity int) int ID func(childComplexity int) int Type func(childComplexity int) int } @@ -100,6 +101,26 @@ type ComplexityRoot struct { Node func(childComplexity int) int } + GitAttestation struct { + Attestation func(childComplexity int) int + Author func(childComplexity int) int + AuthorEmail func(childComplexity int) int + CommitDate func(childComplexity int) int + CommitDigest func(childComplexity int) int + CommitHash func(childComplexity int) int + CommitMessage func(childComplexity int) int + CommitType func(childComplexity int) int + CommitterEmail func(childComplexity int) int + CommitterName func(childComplexity int) int + ID func(childComplexity int) int + ParentHashes func(childComplexity int) int + Refs func(childComplexity int) int + Remotes func(childComplexity int) int + Signature func(childComplexity int) int + Status func(childComplexity int) int + TreeHash func(childComplexity int) int + } + PageInfo struct { EndCursor func(childComplexity int) int HasNextPage func(childComplexity int) int @@ -206,6 +227,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Attestation.AttestationCollection(childComplexity), true + case "Attestation.gitAttestation": + if e.complexity.Attestation.GitAttestation == nil { + break + } + + return e.complexity.Attestation.GitAttestation(childComplexity), true + case "Attestation.id": if e.complexity.Attestation.ID == nil { break @@ -381,6 +409,125 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.DsseEdge.Node(childComplexity), true + case "GitAttestation.attestation": + if e.complexity.GitAttestation.Attestation == nil { + break + } + + return e.complexity.GitAttestation.Attestation(childComplexity), true + + case "GitAttestation.author": + if e.complexity.GitAttestation.Author == nil { + break + } + + return e.complexity.GitAttestation.Author(childComplexity), true + + case "GitAttestation.authorEmail": + if e.complexity.GitAttestation.AuthorEmail == nil { + break + } + + return e.complexity.GitAttestation.AuthorEmail(childComplexity), true + + case "GitAttestation.commitDate": + if e.complexity.GitAttestation.CommitDate == nil { + break + } + + return e.complexity.GitAttestation.CommitDate(childComplexity), true + + case "GitAttestation.commitDigest": + if e.complexity.GitAttestation.CommitDigest == nil { + break + } + + return e.complexity.GitAttestation.CommitDigest(childComplexity), true + + case "GitAttestation.commitHash": + if e.complexity.GitAttestation.CommitHash == nil { + break + } + + return e.complexity.GitAttestation.CommitHash(childComplexity), true + + case "GitAttestation.commitMessage": + if e.complexity.GitAttestation.CommitMessage == nil { + break + } + + return e.complexity.GitAttestation.CommitMessage(childComplexity), true + + case "GitAttestation.commitType": + if e.complexity.GitAttestation.CommitType == nil { + break + } + + return e.complexity.GitAttestation.CommitType(childComplexity), true + + case "GitAttestation.committerEmail": + if e.complexity.GitAttestation.CommitterEmail == nil { + break + } + + return e.complexity.GitAttestation.CommitterEmail(childComplexity), true + + case "GitAttestation.committerName": + if e.complexity.GitAttestation.CommitterName == nil { + break + } + + return e.complexity.GitAttestation.CommitterName(childComplexity), true + + case "GitAttestation.id": + if e.complexity.GitAttestation.ID == nil { + break + } + + return e.complexity.GitAttestation.ID(childComplexity), true + + case "GitAttestation.parentHashes": + if e.complexity.GitAttestation.ParentHashes == nil { + break + } + + return e.complexity.GitAttestation.ParentHashes(childComplexity), true + + case "GitAttestation.refs": + if e.complexity.GitAttestation.Refs == nil { + break + } + + return e.complexity.GitAttestation.Refs(childComplexity), true + + case "GitAttestation.remotes": + if e.complexity.GitAttestation.Remotes == nil { + break + } + + return e.complexity.GitAttestation.Remotes(childComplexity), true + + case "GitAttestation.signature": + if e.complexity.GitAttestation.Signature == nil { + break + } + + return e.complexity.GitAttestation.Signature(childComplexity), true + + case "GitAttestation.status": + if e.complexity.GitAttestation.Status == nil { + break + } + + return e.complexity.GitAttestation.Status(childComplexity), true + + case "GitAttestation.treeHash": + if e.complexity.GitAttestation.TreeHash == nil { + break + } + + return e.complexity.GitAttestation.TreeHash(childComplexity), true + case "PageInfo.endCursor": if e.complexity.PageInfo.EndCursor == nil { break @@ -710,6 +857,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputAttestationPolicyWhereInput, ec.unmarshalInputAttestationWhereInput, ec.unmarshalInputDsseWhereInput, + ec.unmarshalInputGitAttestationWhereInput, ec.unmarshalInputPayloadDigestWhereInput, ec.unmarshalInputSignatureWhereInput, ec.unmarshalInputStatementWhereInput, @@ -1247,6 +1395,83 @@ func (ec *executionContext) fieldContext_Attestation_attestationCollection(_ con return fc, nil } +func (ec *executionContext) _Attestation_gitAttestation(ctx context.Context, field graphql.CollectedField, obj *ent.Attestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Attestation_gitAttestation(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.GitAttestation(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*ent.GitAttestation) + fc.Result = res + return ec.marshalOGitAttestation2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐGitAttestation(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Attestation_gitAttestation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Attestation", + 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_GitAttestation_id(ctx, field) + case "commitHash": + return ec.fieldContext_GitAttestation_commitHash(ctx, field) + case "author": + return ec.fieldContext_GitAttestation_author(ctx, field) + case "authorEmail": + return ec.fieldContext_GitAttestation_authorEmail(ctx, field) + case "committerName": + return ec.fieldContext_GitAttestation_committerName(ctx, field) + case "committerEmail": + return ec.fieldContext_GitAttestation_committerEmail(ctx, field) + case "commitDate": + return ec.fieldContext_GitAttestation_commitDate(ctx, field) + case "commitMessage": + return ec.fieldContext_GitAttestation_commitMessage(ctx, field) + case "status": + return ec.fieldContext_GitAttestation_status(ctx, field) + case "commitType": + return ec.fieldContext_GitAttestation_commitType(ctx, field) + case "commitDigest": + return ec.fieldContext_GitAttestation_commitDigest(ctx, field) + case "signature": + return ec.fieldContext_GitAttestation_signature(ctx, field) + case "parentHashes": + return ec.fieldContext_GitAttestation_parentHashes(ctx, field) + case "treeHash": + return ec.fieldContext_GitAttestation_treeHash(ctx, field) + case "refs": + return ec.fieldContext_GitAttestation_refs(ctx, field) + case "remotes": + return ec.fieldContext_GitAttestation_remotes(ctx, field) + case "attestation": + return ec.fieldContext_GitAttestation_attestation(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GitAttestation", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _AttestationCollection_id(ctx context.Context, field graphql.CollectedField, obj *ent.AttestationCollection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_AttestationCollection_id(ctx, field) if err != nil { @@ -1377,6 +1602,8 @@ func (ec *executionContext) fieldContext_AttestationCollection_attestations(_ co return ec.fieldContext_Attestation_type(ctx, field) case "attestationCollection": return ec.fieldContext_Attestation_attestationCollection(ctx, field) + case "gitAttestation": + return ec.fieldContext_Attestation_gitAttestation(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Attestation", field.Name) }, @@ -2358,8 +2585,8 @@ func (ec *executionContext) fieldContext_DsseEdge_cursor(_ context.Context, fiel return fc, nil } -func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) +func (ec *executionContext) _GitAttestation_id(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_id(ctx, field) if err != nil { return graphql.Null } @@ -2372,7 +2599,7 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.HasNextPage, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -2384,26 +2611,26 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "GitAttestation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) +func (ec *executionContext) _GitAttestation_commitHash(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_commitHash(ctx, field) if err != nil { return graphql.Null } @@ -2416,7 +2643,7 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.HasPreviousPage, nil + return obj.CommitHash, nil }) if err != nil { ec.Error(ctx, err) @@ -2428,26 +2655,26 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_commitHash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "GitAttestation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) +func (ec *executionContext) _GitAttestation_author(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_author(ctx, field) if err != nil { return graphql.Null } @@ -2460,35 +2687,38 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.StartCursor, nil + return obj.Author, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entgql.Cursor[uuid.UUID]) + res := resTmp.(string) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_author(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "GitAttestation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Cursor does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) +func (ec *executionContext) _GitAttestation_authorEmail(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_authorEmail(ctx, field) if err != nil { return graphql.Null } @@ -2501,35 +2731,38 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EndCursor, nil + return obj.AuthorEmail, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entgql.Cursor[uuid.UUID]) + res := resTmp.(string) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_authorEmail(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "GitAttestation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Cursor does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PayloadDigest_id(ctx context.Context, field graphql.CollectedField, obj *ent.PayloadDigest) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PayloadDigest_id(ctx, field) +func (ec *executionContext) _GitAttestation_committerName(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_committerName(ctx, field) if err != nil { return graphql.Null } @@ -2542,7 +2775,7 @@ func (ec *executionContext) _PayloadDigest_id(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.ID, nil + return obj.CommitterName, nil }) if err != nil { ec.Error(ctx, err) @@ -2554,26 +2787,26 @@ func (ec *executionContext) _PayloadDigest_id(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.(string) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PayloadDigest_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_committerName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PayloadDigest", + Object: "GitAttestation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PayloadDigest_algorithm(ctx context.Context, field graphql.CollectedField, obj *ent.PayloadDigest) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PayloadDigest_algorithm(ctx, field) +func (ec *executionContext) _GitAttestation_committerEmail(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_committerEmail(ctx, field) if err != nil { return graphql.Null } @@ -2586,7 +2819,7 @@ func (ec *executionContext) _PayloadDigest_algorithm(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.Algorithm, nil + return obj.CommitterEmail, nil }) if err != nil { ec.Error(ctx, err) @@ -2603,9 +2836,9 @@ func (ec *executionContext) _PayloadDigest_algorithm(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PayloadDigest_algorithm(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_committerEmail(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PayloadDigest", + Object: "GitAttestation", Field: field, IsMethod: false, IsResolver: false, @@ -2616,8 +2849,8 @@ func (ec *executionContext) fieldContext_PayloadDigest_algorithm(_ context.Conte return fc, nil } -func (ec *executionContext) _PayloadDigest_value(ctx context.Context, field graphql.CollectedField, obj *ent.PayloadDigest) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PayloadDigest_value(ctx, field) +func (ec *executionContext) _GitAttestation_commitDate(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_commitDate(ctx, field) if err != nil { return graphql.Null } @@ -2630,7 +2863,7 @@ func (ec *executionContext) _PayloadDigest_value(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.Value, nil + return obj.CommitDate, nil }) if err != nil { ec.Error(ctx, err) @@ -2647,9 +2880,9 @@ func (ec *executionContext) _PayloadDigest_value(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PayloadDigest_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_commitDate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PayloadDigest", + Object: "GitAttestation", Field: field, IsMethod: false, IsResolver: false, @@ -2660,8 +2893,8 @@ func (ec *executionContext) fieldContext_PayloadDigest_value(_ context.Context, return fc, nil } -func (ec *executionContext) _PayloadDigest_dsse(ctx context.Context, field graphql.CollectedField, obj *ent.PayloadDigest) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PayloadDigest_dsse(ctx, field) +func (ec *executionContext) _GitAttestation_commitMessage(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_commitMessage(ctx, field) if err != nil { return graphql.Null } @@ -2674,49 +2907,38 @@ func (ec *executionContext) _PayloadDigest_dsse(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Dsse(ctx) + return obj.CommitMessage, 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.Dsse) + res := resTmp.(string) fc.Result = res - return ec.marshalODsse2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsse(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PayloadDigest_dsse(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_commitMessage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PayloadDigest", + Object: "GitAttestation", 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_Dsse_id(ctx, field) - case "gitoidSha256": - return ec.fieldContext_Dsse_gitoidSha256(ctx, field) - case "payloadType": - return ec.fieldContext_Dsse_payloadType(ctx, field) - case "statement": - return ec.fieldContext_Dsse_statement(ctx, field) - case "signatures": - return ec.fieldContext_Dsse_signatures(ctx, field) - case "payloadDigests": - return ec.fieldContext_Dsse_payloadDigests(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Dsse", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_node(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_node(ctx, field) +func (ec *executionContext) _GitAttestation_status(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_status(ctx, field) if err != nil { return graphql.Null } @@ -2729,46 +2951,38 @@ func (ec *executionContext) _Query_node(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Node(rctx, fc.Args["id"].(uuid.UUID)) + return obj.Status, 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.Noder) + res := resTmp.([]string) fc.Result = res - return ec.marshalONode2githubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "GitAttestation", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_node_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_nodes(ctx, field) +func (ec *executionContext) _GitAttestation_commitType(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_commitType(ctx, field) if err != nil { return graphql.Null } @@ -2781,7 +2995,7 @@ func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]uuid.UUID)) + return obj.CommitType, nil }) if err != nil { ec.Error(ctx, err) @@ -2793,37 +3007,26 @@ func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.([]ent.Noder) + res := resTmp.(string) fc.Result = res - return ec.marshalNNode2ᚕgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_commitType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "GitAttestation", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_nodes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } 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) +func (ec *executionContext) _GitAttestation_commitDigest(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_commitDigest(ctx, field) if err != nil { return graphql.Null } @@ -2836,7 +3039,7 @@ func (ec *executionContext) _Query_attestationPolicies(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AttestationPolicies(rctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.AttestationPolicyWhereInput)) + return obj.CommitDigest, nil }) if err != nil { ec.Error(ctx, err) @@ -2848,45 +3051,26 @@ func (ec *executionContext) _Query_attestationPolicies(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(*ent.AttestationPolicyConnection) + res := resTmp.(string) fc.Result = res - return ec.marshalNAttestationPolicyConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyConnection(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_attestationPolicies(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_commitDigest(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "GitAttestation", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_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) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_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) +func (ec *executionContext) _GitAttestation_signature(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_signature(ctx, field) if err != nil { return graphql.Null } @@ -2899,7 +3083,7 @@ func (ec *executionContext) _Query_dsses(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Dsses(rctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.DsseWhereInput)) + return obj.Signature, nil }) if err != nil { ec.Error(ctx, err) @@ -2911,45 +3095,26 @@ func (ec *executionContext) _Query_dsses(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(*ent.DsseConnection) + res := resTmp.(string) fc.Result = res - return ec.marshalNDsseConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseConnection(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_dsses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_signature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "GitAttestation", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_DsseConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_DsseConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_DsseConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type DsseConnection", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_dsses_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_subjects(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_subjects(ctx, field) +func (ec *executionContext) _GitAttestation_parentHashes(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_parentHashes(ctx, field) if err != nil { return graphql.Null } @@ -2962,7 +3127,7 @@ func (ec *executionContext) _Query_subjects(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Subjects(rctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.SubjectWhereInput)) + return obj.ParentHashes, nil }) if err != nil { ec.Error(ctx, err) @@ -2974,45 +3139,26 @@ func (ec *executionContext) _Query_subjects(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(*ent.SubjectConnection) + res := resTmp.([]string) fc.Result = res - return ec.marshalNSubjectConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectConnection(ctx, field.Selections, res) + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_subjects(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_parentHashes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "GitAttestation", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_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) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_subjects_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___type(ctx, field) +func (ec *executionContext) _GitAttestation_treeHash(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_treeHash(ctx, field) if err != nil { return graphql.Null } @@ -3025,68 +3171,38 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) + return obj.TreeHash, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_treeHash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "GitAttestation", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) +func (ec *executionContext) _GitAttestation_refs(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_refs(ctx, field) if err != nil { return graphql.Null } @@ -3099,49 +3215,38 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() + return obj.Refs, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.([]string) fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_refs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "GitAttestation", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "description": - return ec.fieldContext___Schema_description(ctx, field) - case "types": - return ec.fieldContext___Schema_types(ctx, field) - case "queryType": - return ec.fieldContext___Schema_queryType(ctx, field) - case "mutationType": - return ec.fieldContext___Schema_mutationType(ctx, field) - case "subscriptionType": - return ec.fieldContext___Schema_subscriptionType(ctx, field) - case "directives": - return ec.fieldContext___Schema_directives(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Signature_id(ctx context.Context, field graphql.CollectedField, obj *ent.Signature) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Signature_id(ctx, field) +func (ec *executionContext) _GitAttestation_remotes(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_remotes(ctx, field) if err != nil { return graphql.Null } @@ -3154,7 +3259,7 @@ func (ec *executionContext) _Signature_id(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Remotes, nil }) if err != nil { ec.Error(ctx, err) @@ -3166,26 +3271,26 @@ func (ec *executionContext) _Signature_id(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.([]string) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Signature_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_remotes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Signature", + Object: "GitAttestation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Signature_keyID(ctx context.Context, field graphql.CollectedField, obj *ent.Signature) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Signature_keyID(ctx, field) +func (ec *executionContext) _GitAttestation_attestation(ctx context.Context, field graphql.CollectedField, obj *ent.GitAttestation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitAttestation_attestation(ctx, field) if err != nil { return graphql.Null } @@ -3198,7 +3303,7 @@ func (ec *executionContext) _Signature_keyID(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.KeyID, nil + return obj.Attestation(ctx) }) if err != nil { ec.Error(ctx, err) @@ -3210,26 +3315,36 @@ func (ec *executionContext) _Signature_keyID(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.Attestation) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNAttestation2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestation(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Signature_keyID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitAttestation_attestation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Signature", + Object: "GitAttestation", 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_Attestation_id(ctx, field) + case "type": + return ec.fieldContext_Attestation_type(ctx, field) + case "attestationCollection": + return ec.fieldContext_Attestation_attestationCollection(ctx, field) + case "gitAttestation": + return ec.fieldContext_Attestation_gitAttestation(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Attestation", field.Name) }, } return fc, nil } -func (ec *executionContext) _Signature_signature(ctx context.Context, field graphql.CollectedField, obj *ent.Signature) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Signature_signature(ctx, field) +func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) if err != nil { return graphql.Null } @@ -3242,7 +3357,7 @@ func (ec *executionContext) _Signature_signature(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.Signature, nil + return obj.HasNextPage, nil }) if err != nil { ec.Error(ctx, err) @@ -3254,26 +3369,26 @@ func (ec *executionContext) _Signature_signature(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Signature_signature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Signature", + Object: "PageInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Signature_dsse(ctx context.Context, field graphql.CollectedField, obj *ent.Signature) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Signature_dsse(ctx, field) +func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) if err != nil { return graphql.Null } @@ -3286,49 +3401,38 @@ func (ec *executionContext) _Signature_dsse(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.Dsse(ctx) + return obj.HasPreviousPage, 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.Dsse) + res := resTmp.(bool) fc.Result = res - return ec.marshalODsse2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsse(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Signature_dsse(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Signature", + Object: "PageInfo", 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_Dsse_id(ctx, field) - case "gitoidSha256": - return ec.fieldContext_Dsse_gitoidSha256(ctx, field) - case "payloadType": - return ec.fieldContext_Dsse_payloadType(ctx, field) - case "statement": - return ec.fieldContext_Dsse_statement(ctx, field) - case "signatures": - return ec.fieldContext_Dsse_signatures(ctx, field) - case "payloadDigests": - return ec.fieldContext_Dsse_payloadDigests(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Dsse", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Signature_timestamps(ctx context.Context, field graphql.CollectedField, obj *ent.Signature) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Signature_timestamps(ctx, field) +func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) if err != nil { return graphql.Null } @@ -3341,7 +3445,7 @@ func (ec *executionContext) _Signature_timestamps(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.Timestamps(ctx) + return obj.StartCursor, nil }) if err != nil { ec.Error(ctx, err) @@ -3350,36 +3454,26 @@ func (ec *executionContext) _Signature_timestamps(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.([]*ent.Timestamp) + res := resTmp.(*entgql.Cursor[uuid.UUID]) fc.Result = res - return ec.marshalOTimestamp2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampᚄ(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Signature_timestamps(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Signature", + Object: "PageInfo", 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_Timestamp_id(ctx, field) - case "type": - return ec.fieldContext_Timestamp_type(ctx, field) - case "timestamp": - return ec.fieldContext_Timestamp_timestamp(ctx, field) - case "signature": - return ec.fieldContext_Timestamp_signature(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Timestamp", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Statement_id(ctx context.Context, field graphql.CollectedField, obj *ent.Statement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Statement_id(ctx, field) +func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) if err != nil { return graphql.Null } @@ -3392,38 +3486,35 @@ func (ec *executionContext) _Statement_id(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.EndCursor, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.(*entgql.Cursor[uuid.UUID]) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Statement_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Statement", + Object: "PageInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + return nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Statement_predicate(ctx context.Context, field graphql.CollectedField, obj *ent.Statement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Statement_predicate(ctx, field) +func (ec *executionContext) _PayloadDigest_id(ctx context.Context, field graphql.CollectedField, obj *ent.PayloadDigest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PayloadDigest_id(ctx, field) if err != nil { return graphql.Null } @@ -3436,7 +3527,7 @@ func (ec *executionContext) _Statement_predicate(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.Predicate, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -3448,26 +3539,26 @@ func (ec *executionContext) _Statement_predicate(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(string) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Statement_predicate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PayloadDigest_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Statement", + Object: "PayloadDigest", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Statement_subjects(ctx context.Context, field graphql.CollectedField, obj *ent.Statement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Statement_subjects(ctx, field) +func (ec *executionContext) _PayloadDigest_algorithm(ctx context.Context, field graphql.CollectedField, obj *ent.PayloadDigest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PayloadDigest_algorithm(ctx, field) if err != nil { return graphql.Null } @@ -3480,7 +3571,7 @@ func (ec *executionContext) _Statement_subjects(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Subjects(ctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.SubjectWhereInput)) + return obj.Algorithm, nil }) if err != nil { ec.Error(ctx, err) @@ -3492,45 +3583,26 @@ func (ec *executionContext) _Statement_subjects(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(*ent.SubjectConnection) + res := resTmp.(string) fc.Result = res - return ec.marshalNSubjectConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectConnection(ctx, field.Selections, res) + return ec.marshalNString2string(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_PayloadDigest_algorithm(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Statement", + Object: "PayloadDigest", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_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) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_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) +func (ec *executionContext) _PayloadDigest_value(ctx context.Context, field graphql.CollectedField, obj *ent.PayloadDigest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PayloadDigest_value(ctx, field) if err != nil { return graphql.Null } @@ -3543,43 +3615,38 @@ func (ec *executionContext) _Statement_policy(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.Policy(ctx) + return obj.Value, 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.AttestationPolicy) + res := resTmp.(string) fc.Result = res - return ec.marshalOAttestationPolicy2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicy(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Statement_policy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PayloadDigest_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Statement", + Object: "PayloadDigest", 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_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 AttestationPolicy", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Statement_attestationCollections(ctx context.Context, field graphql.CollectedField, obj *ent.Statement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Statement_attestationCollections(ctx, field) +func (ec *executionContext) _PayloadDigest_dsse(ctx context.Context, field graphql.CollectedField, obj *ent.PayloadDigest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PayloadDigest_dsse(ctx, field) if err != nil { return graphql.Null } @@ -3592,7 +3659,7 @@ func (ec *executionContext) _Statement_attestationCollections(ctx context.Contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AttestationCollections(ctx) + return obj.Dsse(ctx) }) if err != nil { ec.Error(ctx, err) @@ -3601,36 +3668,40 @@ func (ec *executionContext) _Statement_attestationCollections(ctx context.Contex if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.AttestationCollection) + res := resTmp.(*ent.Dsse) fc.Result = res - return ec.marshalOAttestationCollection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollection(ctx, field.Selections, res) + return ec.marshalODsse2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsse(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Statement_attestationCollections(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PayloadDigest_dsse(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Statement", + Object: "PayloadDigest", 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_AttestationCollection_id(ctx, field) - case "name": - return ec.fieldContext_AttestationCollection_name(ctx, field) - case "attestations": - return ec.fieldContext_AttestationCollection_attestations(ctx, field) + return ec.fieldContext_Dsse_id(ctx, field) + case "gitoidSha256": + return ec.fieldContext_Dsse_gitoidSha256(ctx, field) + case "payloadType": + return ec.fieldContext_Dsse_payloadType(ctx, field) case "statement": - return ec.fieldContext_AttestationCollection_statement(ctx, field) + return ec.fieldContext_Dsse_statement(ctx, field) + case "signatures": + return ec.fieldContext_Dsse_signatures(ctx, field) + case "payloadDigests": + return ec.fieldContext_Dsse_payloadDigests(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type AttestationCollection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Dsse", field.Name) }, } return fc, nil } -func (ec *executionContext) _Statement_dsse(ctx context.Context, field graphql.CollectedField, obj *ent.Statement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Statement_dsse(ctx, field) +func (ec *executionContext) _Query_node(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_node(ctx, field) if err != nil { return graphql.Null } @@ -3643,7 +3714,7 @@ func (ec *executionContext) _Statement_dsse(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.Dsse(ctx) + return ec.resolvers.Query().Node(rctx, fc.Args["id"].(uuid.UUID)) }) if err != nil { ec.Error(ctx, err) @@ -3652,40 +3723,37 @@ func (ec *executionContext) _Statement_dsse(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.([]*ent.Dsse) + res := resTmp.(ent.Noder) fc.Result = res - return ec.marshalODsse2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseᚄ(ctx, field.Selections, res) + return ec.marshalONode2githubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐNoder(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Statement_dsse(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Statement", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Dsse_id(ctx, field) - case "gitoidSha256": - return ec.fieldContext_Dsse_gitoidSha256(ctx, field) - case "payloadType": - return ec.fieldContext_Dsse_payloadType(ctx, field) - case "statement": - return ec.fieldContext_Dsse_statement(ctx, field) - case "signatures": - return ec.fieldContext_Dsse_signatures(ctx, field) - case "payloadDigests": - return ec.fieldContext_Dsse_payloadDigests(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Dsse", field.Name) + return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") }, } + 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_node_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Subject_id(ctx context.Context, field graphql.CollectedField, obj *ent.Subject) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Subject_id(ctx, field) +func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_nodes(ctx, field) if err != nil { return graphql.Null } @@ -3698,7 +3766,7 @@ func (ec *executionContext) _Subject_id(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]uuid.UUID)) }) if err != nil { ec.Error(ctx, err) @@ -3710,26 +3778,37 @@ func (ec *executionContext) _Subject_id(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.([]ent.Noder) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalNNode2ᚕgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐNoder(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Subject_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Subject", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") }, } + 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_nodes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Subject_name(ctx context.Context, field graphql.CollectedField, obj *ent.Subject) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Subject_name(ctx, field) +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 } @@ -3742,7 +3821,7 @@ func (ec *executionContext) _Subject_name(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Query().AttestationPolicies(rctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.AttestationPolicyWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -3754,26 +3833,45 @@ func (ec *executionContext) _Subject_name(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.AttestationPolicyConnection) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNAttestationPolicyConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Subject_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_attestationPolicies(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Subject", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "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) _Subject_subjectDigests(ctx context.Context, field graphql.CollectedField, obj *ent.Subject) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Subject_subjectDigests(ctx, field) +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 { return graphql.Null } @@ -3786,45 +3884,57 @@ func (ec *executionContext) _Subject_subjectDigests(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SubjectDigests(ctx) + return ec.resolvers.Query().Dsses(rctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.DsseWhereInput)) }) 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.SubjectDigest) + res := resTmp.(*ent.DsseConnection) fc.Result = res - return ec.marshalOSubjectDigest2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestᚄ(ctx, field.Selections, res) + return ec.marshalNDsseConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Subject_subjectDigests(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_dsses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Subject", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_SubjectDigest_id(ctx, field) - case "algorithm": - return ec.fieldContext_SubjectDigest_algorithm(ctx, field) - case "value": - return ec.fieldContext_SubjectDigest_value(ctx, field) - case "subject": - return ec.fieldContext_SubjectDigest_subject(ctx, field) + case "edges": + return ec.fieldContext_DsseConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_DsseConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_DsseConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type SubjectDigest", field.Name) + return nil, fmt.Errorf("no field named %q was found under type DsseConnection", 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_dsses_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Subject_statement(ctx context.Context, field graphql.CollectedField, obj *ent.Subject) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Subject_statement(ctx, field) +func (ec *executionContext) _Query_subjects(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_subjects(ctx, field) if err != nil { return graphql.Null } @@ -3837,49 +3947,57 @@ func (ec *executionContext) _Subject_statement(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.Statement(ctx) + return ec.resolvers.Query().Subjects(rctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.SubjectWhereInput)) }) 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.Statement) + res := resTmp.(*ent.SubjectConnection) fc.Result = res - return ec.marshalOStatement2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatement(ctx, field.Selections, res) + return ec.marshalNSubjectConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Subject_statement(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_subjects(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Subject", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_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) + 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 Statement", field.Name) + 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_Query_subjects_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _SubjectConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SubjectConnection_edges(ctx, field) +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) if err != nil { return graphql.Null } @@ -3892,7 +4010,7 @@ func (ec *executionContext) _SubjectConnection_edges(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.Edges, nil + return ec.introspectType(fc.Args["name"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -3901,32 +4019,59 @@ func (ec *executionContext) _SubjectConnection_edges(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.([]*ent.SubjectEdge) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalOSubjectEdge2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectEdge(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SubjectConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SubjectConnection", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "node": - return ec.fieldContext_SubjectEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_SubjectEdge_cursor(ctx, field) + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type SubjectEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _SubjectConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SubjectConnection_pageInfo(ctx, field) +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) if err != nil { return graphql.Null } @@ -3939,48 +4084,49 @@ func (ec *executionContext) _SubjectConnection_pageInfo(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return ec.introspectSchema() }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(entgql.PageInfo[uuid.UUID]) + res := resTmp.(*introspection.Schema) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SubjectConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SubjectConnection", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) }, } return fc, nil } -func (ec *executionContext) _SubjectConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SubjectConnection_totalCount(ctx, field) +func (ec *executionContext) _Signature_id(ctx context.Context, field graphql.CollectedField, obj *ent.Signature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Signature_id(ctx, field) if err != nil { return graphql.Null } @@ -3993,7 +4139,7 @@ func (ec *executionContext) _SubjectConnection_totalCount(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -4005,26 +4151,26 @@ func (ec *executionContext) _SubjectConnection_totalCount(ctx context.Context, f } return graphql.Null } - res := resTmp.(int) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SubjectConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Signature_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SubjectConnection", + Object: "Signature", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SubjectDigest_id(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectDigest) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SubjectDigest_id(ctx, field) +func (ec *executionContext) _Signature_keyID(ctx context.Context, field graphql.CollectedField, obj *ent.Signature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Signature_keyID(ctx, field) if err != nil { return graphql.Null } @@ -4037,7 +4183,7 @@ func (ec *executionContext) _SubjectDigest_id(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.ID, nil + return obj.KeyID, nil }) if err != nil { ec.Error(ctx, err) @@ -4049,26 +4195,26 @@ func (ec *executionContext) _SubjectDigest_id(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.(string) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SubjectDigest_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Signature_keyID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SubjectDigest", + Object: "Signature", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SubjectDigest_algorithm(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectDigest) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SubjectDigest_algorithm(ctx, field) +func (ec *executionContext) _Signature_signature(ctx context.Context, field graphql.CollectedField, obj *ent.Signature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Signature_signature(ctx, field) if err != nil { return graphql.Null } @@ -4081,7 +4227,7 @@ func (ec *executionContext) _SubjectDigest_algorithm(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.Algorithm, nil + return obj.Signature, nil }) if err != nil { ec.Error(ctx, err) @@ -4098,9 +4244,9 @@ func (ec *executionContext) _SubjectDigest_algorithm(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SubjectDigest_algorithm(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Signature_signature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SubjectDigest", + Object: "Signature", Field: field, IsMethod: false, IsResolver: false, @@ -4111,8 +4257,8 @@ func (ec *executionContext) fieldContext_SubjectDigest_algorithm(_ context.Conte return fc, nil } -func (ec *executionContext) _SubjectDigest_value(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectDigest) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SubjectDigest_value(ctx, field) +func (ec *executionContext) _Signature_dsse(ctx context.Context, field graphql.CollectedField, obj *ent.Signature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Signature_dsse(ctx, field) if err != nil { return graphql.Null } @@ -4125,38 +4271,49 @@ func (ec *executionContext) _SubjectDigest_value(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.Value, nil + return obj.Dsse(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.Dsse) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalODsse2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsse(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SubjectDigest_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Signature_dsse(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SubjectDigest", + Object: "Signature", 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_Dsse_id(ctx, field) + case "gitoidSha256": + return ec.fieldContext_Dsse_gitoidSha256(ctx, field) + case "payloadType": + return ec.fieldContext_Dsse_payloadType(ctx, field) + case "statement": + return ec.fieldContext_Dsse_statement(ctx, field) + case "signatures": + return ec.fieldContext_Dsse_signatures(ctx, field) + case "payloadDigests": + return ec.fieldContext_Dsse_payloadDigests(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Dsse", field.Name) }, } return fc, nil } -func (ec *executionContext) _SubjectDigest_subject(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectDigest) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SubjectDigest_subject(ctx, field) +func (ec *executionContext) _Signature_timestamps(ctx context.Context, field graphql.CollectedField, obj *ent.Signature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Signature_timestamps(ctx, field) if err != nil { return graphql.Null } @@ -4169,7 +4326,7 @@ func (ec *executionContext) _SubjectDigest_subject(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Subject(ctx) + return obj.Timestamps(ctx) }) if err != nil { ec.Error(ctx, err) @@ -4178,36 +4335,36 @@ func (ec *executionContext) _SubjectDigest_subject(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.Subject) + res := resTmp.([]*ent.Timestamp) fc.Result = res - return ec.marshalOSubject2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubject(ctx, field.Selections, res) + return ec.marshalOTimestamp2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐTimestampᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SubjectDigest_subject(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Signature_timestamps(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SubjectDigest", + Object: "Signature", 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_Subject_id(ctx, field) - case "name": - return ec.fieldContext_Subject_name(ctx, field) - case "subjectDigests": - return ec.fieldContext_Subject_subjectDigests(ctx, field) - case "statement": - return ec.fieldContext_Subject_statement(ctx, field) + return ec.fieldContext_Timestamp_id(ctx, field) + case "type": + return ec.fieldContext_Timestamp_type(ctx, field) + case "timestamp": + return ec.fieldContext_Timestamp_timestamp(ctx, field) + case "signature": + return ec.fieldContext_Timestamp_signature(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Subject", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Timestamp", field.Name) }, } return fc, nil } -func (ec *executionContext) _SubjectEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SubjectEdge_node(ctx, field) +func (ec *executionContext) _Statement_id(ctx context.Context, field graphql.CollectedField, obj *ent.Statement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Statement_id(ctx, field) if err != nil { return graphql.Null } @@ -4220,45 +4377,38 @@ func (ec *executionContext) _SubjectEdge_node(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.Node, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*ent.Subject) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalOSubject2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubject(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SubjectEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Statement_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SubjectEdge", + Object: "Statement", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Subject_id(ctx, field) - case "name": - return ec.fieldContext_Subject_name(ctx, field) - case "subjectDigests": - return ec.fieldContext_Subject_subjectDigests(ctx, field) - case "statement": - return ec.fieldContext_Subject_statement(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Subject", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SubjectEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SubjectEdge_cursor(ctx, field) +func (ec *executionContext) _Statement_predicate(ctx context.Context, field graphql.CollectedField, obj *ent.Statement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Statement_predicate(ctx, field) if err != nil { return graphql.Null } @@ -4271,7 +4421,7 @@ func (ec *executionContext) _SubjectEdge_cursor(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Predicate, nil }) if err != nil { ec.Error(ctx, err) @@ -4283,26 +4433,26 @@ func (ec *executionContext) _SubjectEdge_cursor(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(entgql.Cursor[uuid.UUID]) + res := resTmp.(string) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SubjectEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Statement_predicate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SubjectEdge", + Object: "Statement", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Cursor does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Timestamp_id(ctx context.Context, field graphql.CollectedField, obj *ent.Timestamp) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Timestamp_id(ctx, field) +func (ec *executionContext) _Statement_subjects(ctx context.Context, field graphql.CollectedField, obj *ent.Statement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Statement_subjects(ctx, field) if err != nil { return graphql.Null } @@ -4315,7 +4465,7 @@ func (ec *executionContext) _Timestamp_id(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Subjects(ctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.SubjectWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -4327,26 +4477,45 @@ func (ec *executionContext) _Timestamp_id(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.(*ent.SubjectConnection) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalNSubjectConnection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Timestamp_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Statement_subjects(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Timestamp", + Object: "Statement", 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 ID does not have child fields") + 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) _Timestamp_type(ctx context.Context, field graphql.CollectedField, obj *ent.Timestamp) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Timestamp_type(ctx, field) +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 } @@ -4359,38 +4528,43 @@ func (ec *executionContext) _Timestamp_type(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.Type, nil + return obj.Policy(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.AttestationPolicy) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOAttestationPolicy2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Timestamp_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Statement_policy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Timestamp", + Object: "Statement", 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_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 AttestationPolicy", field.Name) }, } return fc, nil } -func (ec *executionContext) _Timestamp_timestamp(ctx context.Context, field graphql.CollectedField, obj *ent.Timestamp) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Timestamp_timestamp(ctx, field) +func (ec *executionContext) _Statement_attestationCollections(ctx context.Context, field graphql.CollectedField, obj *ent.Statement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Statement_attestationCollections(ctx, field) if err != nil { return graphql.Null } @@ -4403,38 +4577,45 @@ func (ec *executionContext) _Timestamp_timestamp(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.Timestamp, nil + return obj.AttestationCollections(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.(time.Time) + res := resTmp.(*ent.AttestationCollection) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalOAttestationCollection2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Timestamp_timestamp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Statement_attestationCollections(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Timestamp", + Object: "Statement", 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 Time does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_AttestationCollection_id(ctx, field) + case "name": + return ec.fieldContext_AttestationCollection_name(ctx, field) + case "attestations": + return ec.fieldContext_AttestationCollection_attestations(ctx, field) + case "statement": + return ec.fieldContext_AttestationCollection_statement(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AttestationCollection", field.Name) }, } return fc, nil } -func (ec *executionContext) _Timestamp_signature(ctx context.Context, field graphql.CollectedField, obj *ent.Timestamp) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Timestamp_signature(ctx, field) +func (ec *executionContext) _Statement_dsse(ctx context.Context, field graphql.CollectedField, obj *ent.Statement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Statement_dsse(ctx, field) if err != nil { return graphql.Null } @@ -4447,7 +4628,7 @@ func (ec *executionContext) _Timestamp_signature(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.Signature(ctx) + return obj.Dsse(ctx) }) if err != nil { ec.Error(ctx, err) @@ -4456,39 +4637,41 @@ func (ec *executionContext) _Timestamp_signature(ctx context.Context, field grap if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.Signature) + res := resTmp.([]*ent.Dsse) fc.Result = res - return ec.marshalOSignature2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignature(ctx, field.Selections, res) + return ec.marshalODsse2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Timestamp_signature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Statement_dsse(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Timestamp", + Object: "Statement", 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 ec.fieldContext_Dsse_id(ctx, field) + case "gitoidSha256": + return ec.fieldContext_Dsse_gitoidSha256(ctx, field) + case "payloadType": + return ec.fieldContext_Dsse_payloadType(ctx, field) + case "statement": + return ec.fieldContext_Dsse_statement(ctx, field) + case "signatures": + return ec.fieldContext_Dsse_signatures(ctx, field) + case "payloadDigests": + return ec.fieldContext_Dsse_payloadDigests(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 Dsse", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) - if err != nil { +func (ec *executionContext) _Subject_id(ctx context.Context, field graphql.CollectedField, obj *ent.Subject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subject_id(ctx, field) + if err != nil { return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) @@ -4500,7 +4683,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -4512,26 +4695,26 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Subject_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Subject", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) +func (ec *executionContext) _Subject_name(ctx context.Context, field graphql.CollectedField, obj *ent.Subject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subject_name(ctx, field) if err != nil { return graphql.Null } @@ -4544,25 +4727,28 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Subject_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Subject", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -4571,8 +4757,8 @@ func (ec *executionContext) fieldContext___Directive_description(_ context.Conte return fc, nil } -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) +func (ec *executionContext) _Subject_subjectDigests(ctx context.Context, field graphql.CollectedField, obj *ent.Subject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subject_subjectDigests(ctx, field) if err != nil { return graphql.Null } @@ -4585,38 +4771,45 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Locations, nil + return obj.SubjectDigests(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.SubjectDigest) fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalOSubjectDigest2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectDigestᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Subject_subjectDigests(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Subject", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_SubjectDigest_id(ctx, field) + case "algorithm": + return ec.fieldContext_SubjectDigest_algorithm(ctx, field) + case "value": + return ec.fieldContext_SubjectDigest_value(ctx, field) + case "subject": + return ec.fieldContext_SubjectDigest_subject(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SubjectDigest", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_args(ctx, field) +func (ec *executionContext) _Subject_statement(ctx context.Context, field graphql.CollectedField, obj *ent.Subject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subject_statement(ctx, field) if err != nil { return graphql.Null } @@ -4629,48 +4822,49 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.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.([]introspection.InputValue) + res := resTmp.(*ent.Statement) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalOStatement2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐStatement(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Subject_statement(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Subject", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + 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 __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Statement", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) +func (ec *executionContext) _SubjectConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubjectConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -4683,38 +4877,41 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil + return obj.Edges, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*ent.SubjectEdge) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOSubjectEdge2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubjectEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SubjectConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "SubjectConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "node": + return ec.fieldContext_SubjectEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_SubjectEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SubjectEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) +func (ec *executionContext) _SubjectConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubjectConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -4727,7 +4924,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -4739,26 +4936,36 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entgql.PageInfo[uuid.UUID]) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SubjectConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "SubjectConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) +func (ec *executionContext) _SubjectConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubjectConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -4771,35 +4978,38 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.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.(*string) + res := resTmp.(int) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SubjectConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "SubjectConnection", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) +func (ec *executionContext) _SubjectDigest_id(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectDigest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubjectDigest_id(ctx, field) if err != nil { return graphql.Null } @@ -4812,7 +5022,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -4824,26 +5034,26 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SubjectDigest_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "SubjectDigest", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) +func (ec *executionContext) _SubjectDigest_algorithm(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectDigest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubjectDigest_algorithm(ctx, field) if err != nil { return graphql.Null } @@ -4856,25 +5066,28 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.Algorithm, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SubjectDigest_algorithm(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "SubjectDigest", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -4883,8 +5096,8 @@ func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context return fc, nil } -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) +func (ec *executionContext) _SubjectDigest_value(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectDigest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubjectDigest_value(ctx, field) if err != nil { return graphql.Null } @@ -4897,7 +5110,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Value, nil }) if err != nil { ec.Error(ctx, err) @@ -4914,9 +5127,9 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SubjectDigest_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "SubjectDigest", Field: field, IsMethod: false, IsResolver: false, @@ -4927,8 +5140,8 @@ func (ec *executionContext) fieldContext___Field_name(_ context.Context, field g return fc, nil } -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) +func (ec *executionContext) _SubjectDigest_subject(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectDigest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubjectDigest_subject(ctx, field) if err != nil { return graphql.Null } @@ -4941,7 +5154,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Subject(ctx) }) if err != nil { ec.Error(ctx, err) @@ -4950,26 +5163,36 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*ent.Subject) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOSubject2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubject(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SubjectDigest_subject(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "SubjectDigest", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_Subject_id(ctx, field) + case "name": + return ec.fieldContext_Subject_name(ctx, field) + case "subjectDigests": + return ec.fieldContext_Subject_subjectDigests(ctx, field) + case "statement": + return ec.fieldContext_Subject_statement(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Subject", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) +func (ec *executionContext) _SubjectEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubjectEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -4982,48 +5205,45 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.Node, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(*ent.Subject) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalOSubject2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSubject(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SubjectEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "SubjectEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "id": + return ec.fieldContext_Subject_id(ctx, field) case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + return ec.fieldContext_Subject_name(ctx, field) + case "subjectDigests": + return ec.fieldContext_Subject_subjectDigests(ctx, field) + case "statement": + return ec.fieldContext_Subject_statement(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Subject", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_type(ctx, field) +func (ec *executionContext) _SubjectEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.SubjectEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubjectEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -5036,7 +5256,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -5048,48 +5268,26 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(entgql.Cursor[uuid.UUID]) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SubjectEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "SubjectEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) +func (ec *executionContext) _Timestamp_id(ctx context.Context, field graphql.CollectedField, obj *ent.Timestamp) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Timestamp_id(ctx, field) if err != nil { return graphql.Null } @@ -5102,7 +5300,7 @@ func (ec *executionContext) ___Field_isDeprecated(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.IsDeprecated(), nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -5114,26 +5312,26 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Timestamp_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Timestamp", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) +func (ec *executionContext) _Timestamp_type(ctx context.Context, field graphql.CollectedField, obj *ent.Timestamp) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Timestamp_type(ctx, field) if err != nil { return graphql.Null } @@ -5146,25 +5344,28 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Timestamp_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Timestamp", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -5173,8 +5374,8 @@ func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Con return fc, nil } -func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_name(ctx, field) +func (ec *executionContext) _Timestamp_timestamp(ctx context.Context, field graphql.CollectedField, obj *ent.Timestamp) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Timestamp_timestamp(ctx, field) if err != nil { return graphql.Null } @@ -5187,7 +5388,7 @@ func (ec *executionContext) ___InputValue_name(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.Name, nil + return obj.Timestamp, nil }) if err != nil { ec.Error(ctx, err) @@ -5199,26 +5400,26 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(string) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Timestamp_timestamp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "Timestamp", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_description(ctx, field) +func (ec *executionContext) _Timestamp_signature(ctx context.Context, field graphql.CollectedField, obj *ent.Timestamp) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Timestamp_signature(ctx, field) if err != nil { return graphql.Null } @@ -5231,7 +5432,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Signature(ctx) }) if err != nil { ec.Error(ctx, err) @@ -5240,26 +5441,38 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*ent.Signature) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOSignature2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignature(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Timestamp_signature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "Timestamp", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "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) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_type(ctx, field) +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) if err != nil { return graphql.Null } @@ -5272,7 +5485,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -5284,48 +5497,26 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) if err != nil { return graphql.Null } @@ -5338,7 +5529,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -5352,11 +5543,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Directive", 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") @@ -5365,8 +5556,8 @@ func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Con return fc, nil } -func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_description(ctx, field) +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) if err != nil { return graphql.Null } @@ -5379,35 +5570,38 @@ func (ec *executionContext) ___Schema_description(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.Description(), nil + return obj.Locations, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Directive", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type __DirectiveLocation does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_types(ctx, field) +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) if err != nil { return graphql.Null } @@ -5420,7 +5614,7 @@ func (ec *executionContext) ___Schema_types(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.Types(), nil + return obj.Args, nil }) if err != nil { ec.Error(ctx, err) @@ -5432,48 +5626,36 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.([]introspection.InputValue) fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Directive", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___Type_name(ctx, field) + return ec.fieldContext___InputValue_name(ctx, field) case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, } return fc, nil } -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_queryType(ctx, field) +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) if err != nil { return graphql.Null } @@ -5486,7 +5668,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil + return obj.IsRepeatable, nil }) if err != nil { ec.Error(ctx, err) @@ -5498,48 +5680,26 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Directive", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_mutationType(ctx, field) +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) if err != nil { return graphql.Null } @@ -5552,57 +5712,38 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__EnumValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) if err != nil { return graphql.Null } @@ -5615,7 +5756,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -5624,48 +5765,26 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__EnumValue", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_directives(ctx, field) +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -5678,7 +5797,7 @@ func (ec *executionContext) ___Schema_directives(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.Directives(), nil + return obj.IsDeprecated(), nil }) if err != nil { ec.Error(ctx, err) @@ -5690,38 +5809,26 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } return graphql.Null } - res := resTmp.([]introspection.Directive) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__EnumValue", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_kind(ctx, field) +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -5734,38 +5841,35 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil + return obj.DeprecationReason(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__EnumValue", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_name(ctx, field) +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) if err != nil { return graphql.Null } @@ -5778,25 +5882,28 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Field", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -5805,8 +5912,8 @@ func (ec *executionContext) fieldContext___Type_name(_ context.Context, field gr return fc, nil } -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(ctx, field) +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) if err != nil { return graphql.Null } @@ -5833,9 +5940,9 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Field", Field: field, IsMethod: true, IsResolver: false, @@ -5846,8 +5953,8 @@ func (ec *executionContext) fieldContext___Type_description(_ context.Context, f return fc, nil } -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_fields(ctx, field) +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) if err != nil { return graphql.Null } @@ -5860,60 +5967,48 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + return obj.Args, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Field) + res := resTmp.([]introspection.InputValue) fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Field", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "name": - return ec.fieldContext___Field_name(ctx, field) + return ec.fieldContext___InputValue_name(ctx, field) case "description": - return ec.fieldContext___Field_description(ctx, field) - case "args": - return ec.fieldContext___Field_args(ctx, field) + return ec.fieldContext___InputValue_description(ctx, field) case "type": - return ec.fieldContext___Field_type(ctx, field) - case "isDeprecated": - return ec.fieldContext___Field_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___Field_deprecationReason(ctx, field) + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_interfaces(ctx, field) +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) if err != nil { return graphql.Null } @@ -5926,25 +6021,28 @@ func (ec *executionContext) ___Type_interfaces(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.Interfaces(), nil + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - return graphql.Null + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Field", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -5975,8 +6073,8 @@ func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, fi return fc, nil } -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -5989,57 +6087,38 @@ func (ec *executionContext) ___Type_possibleTypes(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.PossibleTypes(), nil + return obj.IsDeprecated(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(bool) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Field", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_enumValues(ctx, field) +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -6052,7 +6131,7 @@ func (ec *executionContext) ___Type_enumValues(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.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + return obj.DeprecationReason(), nil }) if err != nil { ec.Error(ctx, err) @@ -6061,47 +6140,70 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.EnumValue) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Field", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___EnumValue_name(ctx, field) - case "description": - return ec.fieldContext___EnumValue_description(ctx, field) - case "isDeprecated": - return ec.fieldContext___EnumValue_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___EnumValue_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { ec.Error(ctx, err) - return fc, err + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } return fc, nil } -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(ctx, field) +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) if err != nil { return graphql.Null } @@ -6114,7 +6216,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -6123,36 +6225,26 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__InputValue", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_ofType(ctx, field) +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) if err != nil { return graphql.Null } @@ -6165,25 +6257,28 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -6214,8 +6309,8 @@ func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field 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) +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) if err != nil { return graphql.Null } @@ -6228,7 +6323,7 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SpecifiedByURL(), nil + return obj.DefaultValue, nil }) if err != nil { ec.Error(ctx, err) @@ -6242,11 +6337,11 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -6255,41 +6350,1886 @@ func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context return fc, nil } -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} -func (ec *executionContext) 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 +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} - 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 +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } - 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": + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ 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ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "idNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDNEQ = data + case "idIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDIn = data + case "idNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDNotIn = data + case "idGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDGT = data + case "idGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDGTE = data + case "idLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDLT = data + case "idLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(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 + } + } + + return it, nil +} + +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", "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.unmarshalOAttestationPolicyWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOAttestationPolicyWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOAttestationPolicyWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "idNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDNEQ = data + case "idIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDIn = data + case "idNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDNotIn = data + case "idGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDGT = data + case "idGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDGTE = data + case "idLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDLT = data + case "idLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(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 "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 + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Context, obj interface{}) (ent.AttestationWhereInput, error) { + var it ent.AttestationWhereInput + 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", "type", "typeNEQ", "typeIn", "typeNotIn", "typeGT", "typeGTE", "typeLT", "typeLTE", "typeContains", "typeHasPrefix", "typeHasSuffix", "typeEqualFold", "typeContainsFold", "hasAttestationCollection", "hasAttestationCollectionWith", "hasGitAttestation", "hasGitAttestationWith"} + 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.unmarshalOAttestationWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "idNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDNEQ = data + case "idIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDIn = data + case "idNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDNotIn = data + case "idGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDGT = data + case "idGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDGTE = data + case "idLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDLT = data + case "idLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "type": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Type = data + case "typeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TypeNEQ = data + case "typeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TypeIn = data + case "typeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TypeNotIn = data + case "typeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TypeGT = data + case "typeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TypeGTE = data + case "typeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TypeLT = data + case "typeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TypeLTE = data + case "typeContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TypeContains = data + case "typeHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TypeHasPrefix = data + case "typeHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TypeHasSuffix = data + case "typeEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TypeEqualFold = data + case "typeContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TypeContainsFold = data + case "hasAttestationCollection": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestationCollection")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasAttestationCollection = data + case "hasAttestationCollectionWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestationCollectionWith")) + data, err := ec.unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasAttestationCollectionWith = data + case "hasGitAttestation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGitAttestation")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasGitAttestation = data + case "hasGitAttestationWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGitAttestationWith")) + data, err := ec.unmarshalOGitAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐGitAttestationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasGitAttestationWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, obj interface{}) (ent.DsseWhereInput, error) { + var it ent.DsseWhereInput + 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", "gitoidSha256", "gitoidSha256NEQ", "gitoidSha256In", "gitoidSha256NotIn", "gitoidSha256GT", "gitoidSha256GTE", "gitoidSha256LT", "gitoidSha256LTE", "gitoidSha256Contains", "gitoidSha256HasPrefix", "gitoidSha256HasSuffix", "gitoidSha256EqualFold", "gitoidSha256ContainsFold", "payloadType", "payloadTypeNEQ", "payloadTypeIn", "payloadTypeNotIn", "payloadTypeGT", "payloadTypeGTE", "payloadTypeLT", "payloadTypeLTE", "payloadTypeContains", "payloadTypeHasPrefix", "payloadTypeHasSuffix", "payloadTypeEqualFold", "payloadTypeContainsFold", "hasStatement", "hasStatementWith", "hasSignatures", "hasSignaturesWith", "hasPayloadDigests", "hasPayloadDigestsWith"} + 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.unmarshalODsseWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "idNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDNEQ = data + case "idIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDIn = data + case "idNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDNotIn = data + case "idGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDGT = data + case "idGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDGTE = data + case "idLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDLT = data + case "idLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "gitoidSha256": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256 = data + case "gitoidSha256NEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256NEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256NEQ = data + case "gitoidSha256In": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256In")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256In = data + case "gitoidSha256NotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256NotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256NotIn = data + case "gitoidSha256GT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256GT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256GT = data + case "gitoidSha256GTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256GTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256GTE = data + case "gitoidSha256LT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256LT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256LT = data + case "gitoidSha256LTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256LTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256LTE = data + case "gitoidSha256Contains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256Contains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256Contains = data + case "gitoidSha256HasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256HasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256HasPrefix = data + case "gitoidSha256HasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256HasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256HasSuffix = data + case "gitoidSha256EqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256EqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256EqualFold = data + case "gitoidSha256ContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256ContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GitoidSha256ContainsFold = data + case "payloadType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadType")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PayloadType = data + case "payloadTypeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeNEQ = data + case "payloadTypeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeIn = data + case "payloadTypeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeNotIn = data + case "payloadTypeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeGT = data + case "payloadTypeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeGTE = data + case "payloadTypeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeLT = data + case "payloadTypeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeLTE = data + case "payloadTypeContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeContains = data + case "payloadTypeHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeHasPrefix = data + case "payloadTypeHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeHasSuffix = data + case "payloadTypeEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeEqualFold = data + case "payloadTypeContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PayloadTypeContainsFold = 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 + case "hasSignatures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSignatures")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasSignatures = data + case "hasSignaturesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSignaturesWith")) + data, err := ec.unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasSignaturesWith = data + case "hasPayloadDigests": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPayloadDigests")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasPayloadDigests = data + case "hasPayloadDigestsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPayloadDigestsWith")) + data, err := ec.unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasPayloadDigestsWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGitAttestationWhereInput(ctx context.Context, obj interface{}) (ent.GitAttestationWhereInput, error) { + var it ent.GitAttestationWhereInput + 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", "commitHash", "commitHashNEQ", "commitHashIn", "commitHashNotIn", "commitHashGT", "commitHashGTE", "commitHashLT", "commitHashLTE", "commitHashContains", "commitHashHasPrefix", "commitHashHasSuffix", "commitHashEqualFold", "commitHashContainsFold", "author", "authorNEQ", "authorIn", "authorNotIn", "authorGT", "authorGTE", "authorLT", "authorLTE", "authorContains", "authorHasPrefix", "authorHasSuffix", "authorEqualFold", "authorContainsFold", "authorEmail", "authorEmailNEQ", "authorEmailIn", "authorEmailNotIn", "authorEmailGT", "authorEmailGTE", "authorEmailLT", "authorEmailLTE", "authorEmailContains", "authorEmailHasPrefix", "authorEmailHasSuffix", "authorEmailEqualFold", "authorEmailContainsFold", "committerName", "committerNameNEQ", "committerNameIn", "committerNameNotIn", "committerNameGT", "committerNameGTE", "committerNameLT", "committerNameLTE", "committerNameContains", "committerNameHasPrefix", "committerNameHasSuffix", "committerNameEqualFold", "committerNameContainsFold", "committerEmail", "committerEmailNEQ", "committerEmailIn", "committerEmailNotIn", "committerEmailGT", "committerEmailGTE", "committerEmailLT", "committerEmailLTE", "committerEmailContains", "committerEmailHasPrefix", "committerEmailHasSuffix", "committerEmailEqualFold", "committerEmailContainsFold", "commitDate", "commitDateNEQ", "commitDateIn", "commitDateNotIn", "commitDateGT", "commitDateGTE", "commitDateLT", "commitDateLTE", "commitDateContains", "commitDateHasPrefix", "commitDateHasSuffix", "commitDateEqualFold", "commitDateContainsFold", "commitMessage", "commitMessageNEQ", "commitMessageIn", "commitMessageNotIn", "commitMessageGT", "commitMessageGTE", "commitMessageLT", "commitMessageLTE", "commitMessageContains", "commitMessageHasPrefix", "commitMessageHasSuffix", "commitMessageEqualFold", "commitMessageContainsFold", "commitType", "commitTypeNEQ", "commitTypeIn", "commitTypeNotIn", "commitTypeGT", "commitTypeGTE", "commitTypeLT", "commitTypeLTE", "commitTypeContains", "commitTypeHasPrefix", "commitTypeHasSuffix", "commitTypeEqualFold", "commitTypeContainsFold", "commitDigest", "commitDigestNEQ", "commitDigestIn", "commitDigestNotIn", "commitDigestGT", "commitDigestGTE", "commitDigestLT", "commitDigestLTE", "commitDigestContains", "commitDigestHasPrefix", "commitDigestHasSuffix", "commitDigestEqualFold", "commitDigestContainsFold", "signature", "signatureNEQ", "signatureIn", "signatureNotIn", "signatureGT", "signatureGTE", "signatureLT", "signatureLTE", "signatureContains", "signatureHasPrefix", "signatureHasSuffix", "signatureEqualFold", "signatureContainsFold", "treeHash", "treeHashNEQ", "treeHashIn", "treeHashNotIn", "treeHashGT", "treeHashGTE", "treeHashLT", "treeHashLTE", "treeHashContains", "treeHashHasPrefix", "treeHashHasSuffix", "treeHashEqualFold", "treeHashContainsFold", "hasAttestation", "hasAttestationWith"} + 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.unmarshalOGitAttestationWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐGitAttestationWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOGitAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐGitAttestationWhereInputᚄ(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) + data, err := ec.unmarshalOGitAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐGitAttestationWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -6350,850 +8290,1021 @@ func (ec *executionContext) unmarshalInputAttestationCollectionWhereInput(ctx co return it, err } it.IDLTE = data - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + case "commitHash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHash")) 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")) + it.CommitHash = data + case "commitHashNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashNEQ")) 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")) + it.CommitHashNEQ = data + case "commitHashIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashIn")) 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")) + it.CommitHashIn = data + case "commitHashNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CommitHashNotIn = data + case "commitHashGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CommitHashGT = data + case "commitHashGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CommitHashGTE = data + case "commitHashLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CommitHashLT = data + case "commitHashLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CommitHashLTE = data + case "commitHashContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CommitHashContains = data + case "commitHashHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CommitHashHasPrefix = data + case "commitHashHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CommitHashHasSuffix = data + case "commitHashEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CommitHashEqualFold = data + case "commitHashContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitHashContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CommitHashContainsFold = data + case "author": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("author")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Author = data + case "authorNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthorNEQ = data + case "authorIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorIn")) 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")) + it.AuthorIn = data + case "authorNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthorNotIn = data + case "authorGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthorGT = data + case "authorGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthorGTE = data + case "authorLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthorLT = data + case "authorLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthorLTE = data + case "authorContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthorContains = data + case "authorHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthorHasPrefix = data + case "authorHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthorHasSuffix = data + case "authorEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthorEqualFold = data + case "authorContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthorContainsFold = data + case "authorEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmail")) 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")) + it.AuthorEmail = data + case "authorEmailNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailNEQ")) 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")) + it.AuthorEmailNEQ = data + case "authorEmailIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthorEmailIn = data + case "authorEmailNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthorEmailNotIn = data + case "authorEmailGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailGT")) 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")) + it.AuthorEmailGT = data + case "authorEmailGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailGTE")) 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")) + it.AuthorEmailGTE = data + case "authorEmailLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailLT")) 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")) + it.AuthorEmailLT = data + case "authorEmailLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailLTE")) 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")) + it.AuthorEmailLTE = data + case "authorEmailContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailContains")) 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")) + it.AuthorEmailContains = data + case "authorEmailHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailHasPrefix")) 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")) + it.AuthorEmailHasPrefix = data + case "authorEmailHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailHasSuffix")) 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) + it.AuthorEmailHasSuffix = data + case "authorEmailEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(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) + it.AuthorEmailEqualFold = data + case "authorEmailContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorEmailContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(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) + it.AuthorEmailContainsFold = data + case "committerName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerName")) + data, err := ec.unmarshalOString2ᚖstring(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) + it.CommitterName = data + case "committerNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasStatementWith = data - } - } - - return it, nil -} - -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", "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.unmarshalOAttestationPolicyWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInput(ctx, v) + it.CommitterNameNEQ = data + case "committerNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Not = data - case "and": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOAttestationPolicyWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInputᚄ(ctx, v) + it.CommitterNameIn = data + case "committerNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.And = data - case "or": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOAttestationPolicyWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationPolicyWhereInputᚄ(ctx, v) + it.CommitterNameNotIn = data + case "committerNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Or = data - case "id": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitterNameGT = data + case "committerNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ID = data - case "idNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitterNameGTE = data + case "committerNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDNEQ = data - case "idIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) - data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + it.CommitterNameLT = data + case "committerNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDIn = data - case "idNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) - data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + it.CommitterNameLTE = data + case "committerNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDNotIn = data - case "idGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitterNameContains = data + case "committerNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDGT = data - case "idGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitterNameHasPrefix = data + case "committerNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDGTE = data - case "idLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitterNameHasSuffix = data + case "committerNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDLT = data - case "idLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitterNameEqualFold = data + case "committerNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDLTE = data - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.CommitterNameContainsFold = data + case "committerEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmail")) 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")) + it.CommitterEmail = data + case "committerEmailNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailNEQ")) 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")) + it.CommitterEmailNEQ = data + case "committerEmailIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailIn")) 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")) + it.CommitterEmailIn = data + case "committerEmailNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailNotIn")) 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")) + it.CommitterEmailNotIn = data + case "committerEmailGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailGT")) 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")) + it.CommitterEmailGT = data + case "committerEmailGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailGTE")) 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")) + it.CommitterEmailGTE = data + case "committerEmailLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailLT")) 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")) + it.CommitterEmailLT = data + case "committerEmailLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailLTE")) 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")) + it.CommitterEmailLTE = data + case "committerEmailContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailContains")) 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")) + it.CommitterEmailContains = data + case "committerEmailHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailHasPrefix")) 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")) + it.CommitterEmailHasPrefix = data + case "committerEmailHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailHasSuffix")) 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")) + it.CommitterEmailHasSuffix = data + case "committerEmailEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailEqualFold")) 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")) + it.CommitterEmailEqualFold = data + case "committerEmailContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("committerEmailContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.NameContainsFold = data - case "hasStatement": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatement")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + it.CommitterEmailContainsFold = data + case "commitDate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDate")) + data, err := ec.unmarshalOString2ᚖstring(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) + it.CommitDate = data + case "commitDateNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasStatementWith = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputAttestationWhereInput(ctx context.Context, obj interface{}) (ent.AttestationWhereInput, error) { - var it ent.AttestationWhereInput - 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", "type", "typeNEQ", "typeIn", "typeNotIn", "typeGT", "typeGTE", "typeLT", "typeLTE", "typeContains", "typeHasPrefix", "typeHasSuffix", "typeEqualFold", "typeContainsFold", "hasAttestationCollection", "hasAttestationCollectionWith"} - 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.unmarshalOAttestationWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInput(ctx, v) + it.CommitDateNEQ = data + case "commitDateIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Not = data - case "and": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInputᚄ(ctx, v) + it.CommitDateIn = data + case "commitDateNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.And = data - case "or": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInputᚄ(ctx, v) + it.CommitDateNotIn = data + case "commitDateGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Or = data - case "id": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitDateGT = data + case "commitDateGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ID = data - case "idNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitDateGTE = data + case "commitDateLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDNEQ = data - case "idIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) - data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + it.CommitDateLT = data + case "commitDateLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDIn = data - case "idNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) - data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + it.CommitDateLTE = data + case "commitDateContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDNotIn = data - case "idGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitDateContains = data + case "commitDateHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDGT = data - case "idGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitDateHasPrefix = data + case "commitDateHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDGTE = data - case "idLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitDateHasSuffix = data + case "commitDateEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDLT = data - case "idLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitDateEqualFold = data + case "commitDateContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDateContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDLTE = data - case "type": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + it.CommitDateContainsFold = data + case "commitMessage": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessage")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Type = data - case "typeNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeNEQ")) + it.CommitMessage = data + case "commitMessageNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TypeNEQ = data - case "typeIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeIn")) + it.CommitMessageNEQ = data + case "commitMessageIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.TypeIn = data - case "typeNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeNotIn")) + it.CommitMessageIn = data + case "commitMessageNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.TypeNotIn = data - case "typeGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeGT")) + it.CommitMessageNotIn = data + case "commitMessageGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TypeGT = data - case "typeGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeGTE")) + it.CommitMessageGT = data + case "commitMessageGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TypeGTE = data - case "typeLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeLT")) + it.CommitMessageGTE = data + case "commitMessageLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TypeLT = data - case "typeLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeLTE")) + it.CommitMessageLT = data + case "commitMessageLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TypeLTE = data - case "typeContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeContains")) + it.CommitMessageLTE = data + case "commitMessageContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TypeContains = data - case "typeHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeHasPrefix")) + it.CommitMessageContains = data + case "commitMessageHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TypeHasPrefix = data - case "typeHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeHasSuffix")) + it.CommitMessageHasPrefix = data + case "commitMessageHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TypeHasSuffix = data - case "typeEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeEqualFold")) + it.CommitMessageHasSuffix = data + case "commitMessageEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TypeEqualFold = data - case "typeContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeContainsFold")) + it.CommitMessageEqualFold = data + case "commitMessageContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitMessageContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TypeContainsFold = data - case "hasAttestationCollection": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestationCollection")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + it.CommitMessageContainsFold = data + case "commitType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitType")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasAttestationCollection = data - case "hasAttestationCollectionWith": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestationCollectionWith")) - data, err := ec.unmarshalOAttestationCollectionWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationCollectionWhereInputᚄ(ctx, v) + it.CommitType = data + case "commitTypeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasAttestationCollectionWith = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputDsseWhereInput(ctx context.Context, obj interface{}) (ent.DsseWhereInput, error) { - var it ent.DsseWhereInput - 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", "gitoidSha256", "gitoidSha256NEQ", "gitoidSha256In", "gitoidSha256NotIn", "gitoidSha256GT", "gitoidSha256GTE", "gitoidSha256LT", "gitoidSha256LTE", "gitoidSha256Contains", "gitoidSha256HasPrefix", "gitoidSha256HasSuffix", "gitoidSha256EqualFold", "gitoidSha256ContainsFold", "payloadType", "payloadTypeNEQ", "payloadTypeIn", "payloadTypeNotIn", "payloadTypeGT", "payloadTypeGTE", "payloadTypeLT", "payloadTypeLTE", "payloadTypeContains", "payloadTypeHasPrefix", "payloadTypeHasSuffix", "payloadTypeEqualFold", "payloadTypeContainsFold", "hasStatement", "hasStatementWith", "hasSignatures", "hasSignaturesWith", "hasPayloadDigests", "hasPayloadDigestsWith"} - 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.unmarshalODsseWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInput(ctx, v) + it.CommitTypeNEQ = data + case "commitTypeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Not = data - case "and": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) + it.CommitTypeIn = data + case "commitTypeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.And = data - case "or": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalODsseWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐDsseWhereInputᚄ(ctx, v) + it.CommitTypeNotIn = data + case "commitTypeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Or = data - case "id": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitTypeGT = data + case "commitTypeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ID = data - case "idNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitTypeGTE = data + case "commitTypeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDNEQ = data - case "idIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) - data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + it.CommitTypeLT = data + case "commitTypeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDIn = data - case "idNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) - data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + it.CommitTypeLTE = data + case "commitTypeContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDNotIn = data - case "idGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitTypeContains = data + case "commitTypeHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDGT = data - case "idGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitTypeHasPrefix = data + case "commitTypeHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDGTE = data - case "idLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitTypeHasSuffix = data + case "commitTypeEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDLT = data - case "idLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.CommitTypeEqualFold = data + case "commitTypeContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitTypeContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.IDLTE = data - case "gitoidSha256": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256")) + it.CommitTypeContainsFold = data + case "commitDigest": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigest")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GitoidSha256 = data - case "gitoidSha256NEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256NEQ")) + it.CommitDigest = data + case "commitDigestNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GitoidSha256NEQ = data - case "gitoidSha256In": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256In")) + it.CommitDigestNEQ = data + case "commitDigestIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.GitoidSha256In = data - case "gitoidSha256NotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256NotIn")) + it.CommitDigestIn = data + case "commitDigestNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.GitoidSha256NotIn = data - case "gitoidSha256GT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256GT")) + it.CommitDigestNotIn = data + case "commitDigestGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GitoidSha256GT = data - case "gitoidSha256GTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256GTE")) + it.CommitDigestGT = data + case "commitDigestGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GitoidSha256GTE = data - case "gitoidSha256LT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256LT")) + it.CommitDigestGTE = data + case "commitDigestLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GitoidSha256LT = data - case "gitoidSha256LTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256LTE")) + it.CommitDigestLT = data + case "commitDigestLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GitoidSha256LTE = data - case "gitoidSha256Contains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256Contains")) + it.CommitDigestLTE = data + case "commitDigestContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GitoidSha256Contains = data - case "gitoidSha256HasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256HasPrefix")) + it.CommitDigestContains = data + case "commitDigestHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GitoidSha256HasPrefix = data - case "gitoidSha256HasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256HasSuffix")) + it.CommitDigestHasPrefix = data + case "commitDigestHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GitoidSha256HasSuffix = data - case "gitoidSha256EqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256EqualFold")) + it.CommitDigestHasSuffix = data + case "commitDigestEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestEqualFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GitoidSha256EqualFold = data - case "gitoidSha256ContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitoidSha256ContainsFold")) + it.CommitDigestEqualFold = data + case "commitDigestContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commitDigestContainsFold")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GitoidSha256ContainsFold = data - case "payloadType": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadType")) + it.CommitDigestContainsFold = data + case "signature": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signature")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.PayloadType = data - case "payloadTypeNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeNEQ")) + it.Signature = data + case "signatureNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.PayloadTypeNEQ = data - case "payloadTypeIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeIn")) + it.SignatureNEQ = data + case "signatureIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.PayloadTypeIn = data - case "payloadTypeNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeNotIn")) + it.SignatureIn = data + case "signatureNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.PayloadTypeNotIn = data - case "payloadTypeGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeGT")) + it.SignatureNotIn = data + case "signatureGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.PayloadTypeGT = data - case "payloadTypeGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeGTE")) + it.SignatureGT = data + case "signatureGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.PayloadTypeGTE = data - case "payloadTypeLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeLT")) + it.SignatureGTE = data + case "signatureLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.PayloadTypeLT = data - case "payloadTypeLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeLTE")) + it.SignatureLT = data + case "signatureLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SignatureLTE = data + case "signatureContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SignatureContains = data + case "signatureHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SignatureHasPrefix = data + case "signatureHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SignatureHasSuffix = data + case "signatureEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SignatureEqualFold = data + case "signatureContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signatureContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SignatureContainsFold = data + case "treeHash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHash")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TreeHash = data + case "treeHashNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.PayloadTypeLTE = data - case "payloadTypeContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeContains")) + it.TreeHashNEQ = data + case "treeHashIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TreeHashIn = data + case "treeHashNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TreeHashNotIn = data + case "treeHashGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.PayloadTypeContains = data - case "payloadTypeHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeHasPrefix")) + it.TreeHashGT = data + case "treeHashGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.PayloadTypeHasPrefix = data - case "payloadTypeHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeHasSuffix")) + it.TreeHashGTE = data + case "treeHashLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.PayloadTypeHasSuffix = data - case "payloadTypeEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeEqualFold")) + it.TreeHashLT = data + case "treeHashLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.PayloadTypeEqualFold = data - case "payloadTypeContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadTypeContainsFold")) + it.TreeHashLTE = data + case "treeHashContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.PayloadTypeContainsFold = data - case "hasStatement": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasStatement")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + it.TreeHashContains = data + case "treeHashHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(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) + it.TreeHashHasPrefix = data + case "treeHashHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasStatementWith = data - case "hasSignatures": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSignatures")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + it.TreeHashHasSuffix = data + case "treeHashEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasSignatures = data - case "hasSignaturesWith": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSignaturesWith")) - data, err := ec.unmarshalOSignatureWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐSignatureWhereInputᚄ(ctx, v) + it.TreeHashEqualFold = data + case "treeHashContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("treeHashContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasSignaturesWith = data - case "hasPayloadDigests": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPayloadDigests")) + it.TreeHashContainsFold = data + case "hasAttestation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestation")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.HasPayloadDigests = data - case "hasPayloadDigestsWith": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPayloadDigestsWith")) - data, err := ec.unmarshalOPayloadDigestWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐPayloadDigestWhereInputᚄ(ctx, v) + it.HasAttestation = data + case "hasAttestationWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAttestationWith")) + data, err := ec.unmarshalOAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐAttestationWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.HasPayloadDigestsWith = data + it.HasAttestationWith = data } } @@ -8839,6 +10950,11 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._Dsse(ctx, sel, obj) + case *ent.GitAttestation: + if obj == nil { + return graphql.Null + } + return ec._GitAttestation(ctx, sel, obj) case *ent.PayloadDigest: if obj == nil { return graphql.Null @@ -8934,6 +11050,39 @@ func (ec *executionContext) _Attestation(ctx context.Context, sel ast.SelectionS continue } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "gitAttestation": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Attestation_gitAttestation(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) }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -9470,6 +11619,156 @@ func (ec *executionContext) _DsseEdge(ctx context.Context, sel ast.SelectionSet, return out } +var gitAttestationImplementors = []string{"GitAttestation", "Node"} + +func (ec *executionContext) _GitAttestation(ctx context.Context, sel ast.SelectionSet, obj *ent.GitAttestation) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, gitAttestationImplementors) + + 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("GitAttestation") + case "id": + out.Values[i] = ec._GitAttestation_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "commitHash": + out.Values[i] = ec._GitAttestation_commitHash(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "author": + out.Values[i] = ec._GitAttestation_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "authorEmail": + out.Values[i] = ec._GitAttestation_authorEmail(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "committerName": + out.Values[i] = ec._GitAttestation_committerName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "committerEmail": + out.Values[i] = ec._GitAttestation_committerEmail(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "commitDate": + out.Values[i] = ec._GitAttestation_commitDate(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "commitMessage": + out.Values[i] = ec._GitAttestation_commitMessage(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "status": + out.Values[i] = ec._GitAttestation_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "commitType": + out.Values[i] = ec._GitAttestation_commitType(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "commitDigest": + out.Values[i] = ec._GitAttestation_commitDigest(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "signature": + out.Values[i] = ec._GitAttestation_signature(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "parentHashes": + out.Values[i] = ec._GitAttestation_parentHashes(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "treeHash": + out.Values[i] = ec._GitAttestation_treeHash(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "refs": + out.Values[i] = ec._GitAttestation_refs(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "remotes": + out.Values[i] = ec._GitAttestation_remotes(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "attestation": + 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._GitAttestation_attestation(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 pageInfoImplementors = []string{"PageInfo"} func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *entgql.PageInfo[uuid.UUID]) graphql.Marshaler { @@ -10841,6 +13140,11 @@ func (ec *executionContext) unmarshalNDsseWhereInput2ᚖgithubᚗcomᚋinᚑtoto return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) unmarshalNGitAttestationWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐGitAttestationWhereInput(ctx context.Context, v interface{}) (*ent.GitAttestationWhereInput, error) { + res, err := ec.unmarshalInputGitAttestationWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx context.Context, v interface{}) (uuid.UUID, error) { res, err := uuidgql.UnmarshalUUID(v) return res, graphql.ErrorOnPath(ctx, err) @@ -11005,6 +13309,38 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S return res } +func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + 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) } @@ -11687,6 +14023,41 @@ func (ec *executionContext) unmarshalODsseWhereInput2ᚖgithubᚗcomᚋinᚑtoto return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalOGitAttestation2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐGitAttestation(ctx context.Context, sel ast.SelectionSet, v *ent.GitAttestation) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GitAttestation(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOGitAttestationWhereInput2ᚕᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐGitAttestationWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.GitAttestationWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*ent.GitAttestationWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGitAttestationWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐGitAttestationWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOGitAttestationWhereInput2ᚖgithubᚗcomᚋinᚑtotoᚋarchivistaᚋentᚐGitAttestationWhereInput(ctx context.Context, v interface{}) (*ent.GitAttestationWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGitAttestationWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx context.Context, v interface{}) ([]uuid.UUID, error) { if v == nil { return nil, nil diff --git a/go.mod b/go.mod index c4915650..01768182 100644 --- a/go.mod +++ b/go.mod @@ -32,9 +32,12 @@ require ( require ( ariga.io/atlas v0.21.1 // indirect + dario.cat/mergo v1.0.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/KyleBanks/depth v1.2.1 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect github.com/OneOfOne/xxhash v1.2.8 // indirect + github.com/ProtonMail/go-crypto v1.0.0 // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/agnivade/levenshtein v1.1.1 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect @@ -42,10 +45,16 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudflare/circl v1.3.7 // indirect + github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/emirpasic/gods v1.18.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect + github.com/go-git/go-billy/v5 v5.5.0 // indirect + github.com/go-git/go-git/v5 v5.11.0 // indirect github.com/go-ini/ini v1.67.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -67,8 +76,10 @@ require ( github.com/hashicorp/hcl/v2 v2.20.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/invopop/jsonschema v0.12.0 // indirect + github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/klauspost/compress v1.17.8 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -79,6 +90,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-policy-agent/opa v0.64.0 // indirect + github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -86,7 +98,9 @@ require ( github.com/prometheus/procfs v0.14.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rs/xid v1.5.0 // indirect + github.com/sergi/go-diff v1.3.1 // indirect github.com/sigstore/fulcio v1.4.5 // indirect + github.com/skeema/knownhosts v1.2.1 // indirect github.com/sosodev/duration v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect @@ -95,6 +109,7 @@ require ( github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect + github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/yashtewari/glob-intersection v0.2.0 // indirect @@ -115,6 +130,7 @@ require ( google.golang.org/protobuf v1.34.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/apimachinery v0.30.0 // indirect k8s.io/klog/v2 v2.120.1 // indirect diff --git a/go.sum b/go.sum index 66a17e79..efd6fdb8 100644 --- a/go.sum +++ b/go.sum @@ -18,6 +18,7 @@ github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20O github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= +github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= @@ -34,12 +35,16 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNg github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/antonfisher/nested-logrus-formatter v1.3.1 h1:NFJIr+pzwv5QLHTPyKz9UMEoHck02Q9L0FP13b/xSbQ= github.com/antonfisher/nested-logrus-formatter v1.3.1/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/config v1.27.13 h1:WbKW8hOzrWoOA/+35S5okqO/2Ap8hkkFUzoW8Hzq24A= @@ -74,6 +79,7 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 h1:3uZCA/BLTIu+DqCfguByNMJa2HVHpXvjfy0Dy7g6fuA= github.com/bytecodealliance/wasmtime-go/v3 v3.0.2/go.mod h1:RnUjnIXxEJcL6BgCvNyzCCRzZcxCgsZCi+RNlvYor5Q= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= @@ -84,6 +90,7 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -109,6 +116,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/edwarnicke/gitoid v0.0.0-20220710194850-1be5bfda1f9d h1:4l+Uq5zFWSagXgGFaKRRVWJrnlzeathyagWgYUltCgY= github.com/edwarnicke/gitoid v0.0.0-20220710194850-1be5bfda1f9d/go.mod h1:WxWwA3EYuCQjlR5EBUX3uaTS8bh9BOa7BcqVREHQ0uQ= +github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= +github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -121,10 +130,14 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/foxcpp/go-mockdns v1.1.0 h1:jI0rD8M0wuYAxL7r/ynTrCQQq0BVqfB99Vgk7DlmewI= github.com/foxcpp/go-mockdns v1.1.0/go.mod h1:IhLeSFGed3mJIAXPH2aiRQB+kqz7oqu8ld2qVbOu7Wk= +github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= +github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= +github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= @@ -233,8 +246,11 @@ github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ib github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= @@ -260,6 +276,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE= +github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk= github.com/open-policy-agent/opa v0.64.0 h1:2g0JTt78zxhFaoBmZViY4UXvtOlzBjhhrnyrIxkm+tI= github.com/open-policy-agent/opa v0.64.0/go.mod h1:j4VeLorVpKipnkQ2TDjWshEuV3cvP/rHzQhYaraUXZY= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= @@ -289,6 +307,7 @@ github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/sigstore/fulcio v1.4.5 h1:WWNnrOknD0DbruuZWCbN+86WRROpEl3Xts+WT2Ek1yc= github.com/sigstore/fulcio v1.4.5/go.mod h1:oz3Qwlma8dWcSS/IENR/6SjbW4ipN0cxpRVfgdsjMU8= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= @@ -304,7 +323,9 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -337,6 +358,7 @@ github.com/yashtewari/glob-intersection v0.2.0 h1:8iuHdN88yYuCzCdjt0gDe+6bAhUwBe github.com/yashtewari/glob-intersection v0.2.0/go.mod h1:LK7pIC3piUjovexikBbJ26Yml7g8xa5bsjfx2v1fwok= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= @@ -362,6 +384,10 @@ go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v8 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -372,6 +398,8 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -383,6 +411,12 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -391,18 +425,42 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -413,6 +471,8 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -448,6 +508,7 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -456,6 +517,7 @@ gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/pkg/metadatastorage/attestationcollection/git_parser/git_parser.go b/pkg/metadatastorage/attestationcollection/git_parser/git_parser.go new file mode 100644 index 00000000..85937970 --- /dev/null +++ b/pkg/metadatastorage/attestationcollection/git_parser/git_parser.go @@ -0,0 +1,74 @@ +// 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 git_parser + +import ( + "context" + "encoding/json" + "github.com/in-toto/archivista/ent" + "github.com/in-toto/archivista/pkg/metadatastorage/attestationcollection" + "github.com/in-toto/go-witness/attestation/git" +) + +func init() { + // register with parser_registry if the parser_registry exists + attestationcollection.Register("https://witness.dev/attestations/git/v0.1", Parse) +} + +// register with parser_registry if the parser_registry exists + +func Parse(ctx context.Context, tx *ent.Tx, attestation *ent.Attestation, attestationType string, message json.RawMessage) error { + gitAttestation := git.Attestor{ + CommitHash: "", + Author: "", + AuthorEmail: "", + CommitterName: "", + CommitterEmail: "", + CommitDate: "", + CommitMessage: "", + Status: nil, + CommitDigest: nil, + Signature: "", + ParentHashes: nil, + TreeHash: "", + Refs: nil, + Remotes: nil, + Tags: nil, + } + + if err := json.Unmarshal(message, &gitAttestation); err != nil { + return err + } + + if _, err := tx.GitAttestation.Create(). + SetAttestation(attestation). + SetCommitHash(gitAttestation.CommitHash). + SetAuthor(gitAttestation.Author). + SetAuthorEmail(gitAttestation.AuthorEmail). + SetCommitterName(gitAttestation.CommitterName). + SetCommitterEmail(gitAttestation.CommitterEmail). + SetCommitMessage(gitAttestation.CommitMessage). + SetCommitDate(gitAttestation.CommitDate). + SetSignature(gitAttestation.Signature). + SetParentHashes(gitAttestation.ParentHashes). + SetTreeHash(gitAttestation.TreeHash). + SetRefs(gitAttestation.Refs). + SetRemotes(gitAttestation.Remotes). + //SetTags(gitAttestation.Tags). // Implement after we have a graphql marshal/unmarshal for tags + Save(ctx); err != nil { + return err + } + + return nil +} diff --git a/pkg/metadatastorage/attestationcollection/git_parser/git_parser_test.go b/pkg/metadatastorage/attestationcollection/git_parser/git_parser_test.go new file mode 100644 index 00000000..63c54893 --- /dev/null +++ b/pkg/metadatastorage/attestationcollection/git_parser/git_parser_test.go @@ -0,0 +1,14 @@ +// 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 git_parser